How are array elements commonly stored?
A As unrelated files
B Only in processor registers
C In a network queue
D In contiguous memory
Answer: D. In contiguous memory. Contiguous storage enables direct indexed access to array elements.
What is typical indexed array access time?
A O(log n)
B O(n)
C O(n squared)
D O(1)
Answer: D. O(1). An array index computes an element address directly in constant time.
What does a linked list node usually contain?
A Data and link
B Only an index
C A sort key only
D A file descriptor
Answer: A. Data and link. A node stores data and one or more links to other nodes.
What link does a singly linked node have?
A Next node link
B Previous and next links
C Parent and child links
D No links at all
Answer: A. Next node link. A singly linked list node points forward to its successor.
What does a list head identify?
A Last array index
B Middle element
C First node
D Empty queue slot
Answer: C. First node. The head reference identifies the first node in a linked list.
What is head insertion time in a linked list?
A O(log n)
B O(1)
C O(n)
D O(n squared)
Answer: B. O(1). When the head is known, inserting before it needs only a few pointer updates.
How long can indexed access take in a singly linked list?
A O(1)
B O(n)
C O(log n)
D O(n squared)
Answer: B. O(n). A list may require traversing nodes from the head to reach an index.
What links does a doubly linked node keep?
A Only a parent link
B Two data values
C A hash and key
D Previous and next links
Answer: D. Previous and next links. Doubly linked nodes link to both their predecessor and successor.
What does a circular list's last node link to?
A A null byte
B The middle node
C The head node
D The list length
Answer: C. The head node. In a circular list the last node links back to the first node.
Which order does a stack follow?
A First in, first out
B Smallest value first
C Last in, first out
D Highest priority first
Answer: C. Last in, first out. A stack removes the most recently added item first.
What does push do to a stack?
A Removes bottom item
B Adds item on top
C Sorts all items
D Reads queue front
Answer: B. Adds item on top. Push inserts an item at the top of a stack.
What does pop do to a stack?
A Adds item at bottom
B Reads every item
C Reverses the links
D Removes top item
Answer: D. Removes top item. Pop removes and returns the top item.
What does peek do on a stack?
A Adds a new top item
B Reads top without removal
C Removes the whole stack
D Sorts the stored values
Answer: B. Reads top without removal. Peek inspects the top item while leaving the stack unchanged.
Which order does a queue follow?
A First in, first out
B Last in, first out
C Largest value first
D Newest value first
Answer: A. First in, first out. A queue normally removes items in arrival order.
Where does enqueue add an item?
A At the front
B At the middle
C At the root
D At the rear
Answer: D. At the rear. Enqueue inserts a new item at the rear of a queue.
Where does dequeue remove an item?
A At the front
B At the rear
C At the middle
D At the root
Answer: A. At the front. Dequeue removes the oldest item from the front.
Why use a circular queue?
A Keep values sorted
B Avoid all indexes
C Reuse freed array slots
D Store tree parents
Answer: C. Reuse freed array slots. A circular queue wraps indices to reuse space freed at the front.
What can a deque support?
A Only sorted insertion
B Only random lookup
C Insertion at both ends
D Tree rotations only
Answer: C. Insertion at both ends. A double ended queue allows operations at both its front and rear.
How does a priority queue choose removal?
A By insertion address
B By item priority
C By array capacity
D By alphabetical index
Answer: B. By item priority. A priority queue removes an item according to its priority ordering.
What is stack underflow?
A Adding beyond fixed capacity
B Sorting a queue
C Linking the first node
D Removing from an empty stack
Answer: D. Removing from an empty stack. Underflow occurs when removal is requested from an empty stack.
What is overflow in a fixed stack?
A Removing the final item
B Reading its top value
C Adding beyond its capacity
D Reversing its stored items
Answer: C. Adding beyond its capacity. A fixed-capacity stack overflows when another item cannot fit.
Which structure checks nested delimiters naturally?
A Queue
B Stack
C Heap
D Hash table
Answer: B. Stack. A stack matches opening and closing delimiters in nested order.
Which structure commonly supports breadth first search?
A Queue
B Stack
C Binary heap
D Hash set
Answer: A. Queue. Breadth first search processes discovered vertices with a queue.
What is an array's main insertion limitation?
A Middle insertion shifts elements
B It cannot store numbers
C It has no indexes
D It cannot be traversed
Answer: A. Middle insertion shifts elements. Inserting into the middle of an array may require shifting later elements.
Which list supports backward traversal directly?
A Doubly linked list
B Singly linked list
C Circular queue
D Binary heap
Answer: A. Doubly linked list. A doubly linked list stores predecessor links for backward traversal.