1.Easy
What is the load factor of a hash table?
- AThe number of buckets divided by the average length of the keys stored
- BThe number of collisions so far
- CThe number of stored elements divided by the number of buckets
- DThe time needed to load the table from disk
2.Easy
In a tree, what is a leaf?
- AA node with exactly one child
- BA node with no children
- CA node with no parent
- DThe node with the largest value
3.Easy
In a singly linked list, what does the next pointer of the last node contain?
- AThe address of the first node
- BNull (no node)
- CThe number of nodes in the list
- DThe address of the previous node
4.Medium
Why can a binary heap be stored in an array without any pointers?
- AIt is a complete binary tree, so positions follow simple index formulas
- BHeaps never contain more than 100 elements
- CArrays automatically keep the keys in sorted order, so no pointers are needed
- DAll keys in a heap are equal
5.Medium
You have a reference to a node in the middle of a list. In which list can you remove it in O(1)?
- AA dynamic array
- BA singly linked list
- CA sorted array
- DA doubly linked list
6.Medium
How is a new element inserted into a binary heap?
- APlace it at the end of the array and sift it up while it violates the heap property
- BInsert it at its sorted position by shifting all of the larger elements one place right
- CPlace it at the root and sift it down
- DRebuild the whole heap from scratch
7.Hard
How long does it take to search for an arbitrary key in a binary min-heap of n elements?
- AO(log n)
- BO(log log n)
- CO(1)
- DO(n)
8.Hard
In the BST with root 50, left subtree 30 (children 20, 40) and right subtree 70 (children 60, 80), the root is deleted using the in-order successor. Which key becomes the new root?
- A80
- B60
- C40
- D70
Answer key
- 1. C · The number of stored elements divided by the number of buckets
- 2. B · A node with no children
- 3. B · Null (no node)
- 4. A · It is a complete binary tree, so positions follow simple index formulas
- 5. D · A doubly linked list
- 6. A · Place it at the end of the array and sift it up while it violates the heap property
- 7. D · O(n)
- 8. B · 60
Full step-by-step solutions: practise this topic on examproblems.com.