100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COEN 12 Midterm 2 (70+ Questions) – Linked Lists, Stacks, Queues, Trees, BST, Heaps – Santa Clara University

Rating
-
Sold
-
Pages
47
Grade
A+
Uploaded on
25-09-2025
Written in
2025/2026

This document presents an extensive and detailed set of over 70 questions and answers from Midterm 2 of COEN 12: Data Structures at Santa Clara University, for the 2025/2026 academic year. It offers deep coverage of key abstract data types and dynamic structures essential to data management, algorithm design, and efficient memory use. Every concept is explained in a concise question-and-answer format, making this document highly effective for exam preparation or concept reinforcement. Key topics include: List ADTs: unordered lists, stacks (LIFO), queues (FIFO), and their real-world applications Runtime analysis for operations like insertion, deletion, and traversal in both arrays and linked structures Singly, doubly, and circular linked lists, with code-level explanations for inserting and deleting nodes Stack and queue implementations (including circular queues), with clear runtime breakdowns Tree structures including terminology (e.g., root, leaf, sibling), recursive traversal (pre-order, in-order, post-order), and tree height calculation Binary Search Trees (BSTs): definition, recursive and iterative search/insertion/deletion, balance properties, min/max retrieval Priority queues and heaps, including insertion and deletion operations, heap property maintenance, and array-based implementations Also included are runtime complexities for all major operations in sets and bags, implemented with both sorted and unsorted singly linked lists, and variations using head-only or head-and-tail pointer structures. This document is ideal for students in: Computer Science Software Engineering Computer Engineering Electrical and Computer Engineering Information Technology It is especially helpful for mastering recursive logic, dynamic memory structures, and the time-space trade-offs in data handling. The detailed explanations and embedded C-style code examples make this resource useful not only for exam preparation but also for coding interviews and academic projects. Keywords: COEN 12, midterm exam, data structures, linked list, singly linked list, doubly linked list, circular list, stack, queue, runtime complexity, recursion, tree traversal, binary tree, binary search tree, BST, preorder, inorder, postorder, priority queue, binary heap, heap insertion, heap deletion, dynamic memory, abstract data types, set, bag, head pointer, tail pointer

Show more Read less
Institution
Module











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Module

Document information

Uploaded on
September 25, 2025
Number of pages
47
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COEN 12 MIDTERM 2 2025/2026 Exam
Questions and Verified Answers |
Already Graded A+



List - 🧠 ANSWER ✔✔unordered collection of items, not necessarily distinct

(other ADT outside of SET and BAG)


Types of List - 🧠 ANSWER ✔✔1. stacks


2. queue


How to search a List - 🧠 ANSWER ✔✔-indexing


-name/id/key

-position


Stack - 🧠 ANSWER ✔✔-linear list with all additions and deletions restricted

to one end (top)

,-insert: push

-remove/delete: pop

-obeys last in first out (LIFO)

-uses an array


When to Use Stack - 🧠 ANSWER ✔✔Where we need to remember a bunch

of things and go back to the most recent:

-stack of plates

-back button on browser

-undo button


Stack (Push) - 🧠 ANSWER ✔✔- n is the number of elements


- m is the length of the array

assert (n<m);

a[n] = x;

n++;




runtime: O(1)

,Stack (Pop) - 🧠 ANSWER ✔✔- n is the number of elements


- m is the length of the array

assert (n>0);

x = a[n-1];

n--;

return x; //deleted value




runtime: O(1)


Queue - 🧠 ANSWER ✔✔-linear list in which data can only be inserted at

one end (rear) and deleted from other end (front)

-obeys first-in and first-out (FIFO)

-removes oldest item to ensure fairness

-implementation through an array


Enqueue - 🧠 ANSWER ✔✔-insertion


1. add at end

2. remove from the front (always keep front of queue at index 0)


COPYRIGHT©PROFFKERRYMARTIN 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE.
PRIVACY STATEMENT. ALL RIGHTS RESERVED

, assert (n<m);

a[n]=x;

n++;

Runtime: O(1)


Dequeue (stagnant index) - 🧠 ANSWER ✔✔-deletion


assert (n>0);

x=a[0];

n--;

for (i=0;i<n-1;i=i+2)

a[i]=a[i+1];

return x;

Runtime: O(n-1) = O(n) //without moving front of array


When to Use Queues - 🧠 ANSWER ✔✔-Grocery shopping line


-Youtube playlist

-Office hours
£11.95
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
PROFFKERRYMARTIN Liberty University
Follow You need to be logged in order to follow users or courses
Sold
107
Member since
10 months
Number of followers
1
Documents
7908
Last sold
3 hours ago
KERRYMARTIN

KERRYMARTIN EXAM HUB Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
3.4

21 reviews

5
9
4
2
3
4
2
1
1
5

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions