Which operation is slow in an array but fast at the head of a linked list?
- AInserting at the beginning
- BAccessing the 5th element
- CReading the last element by index
- DFinding the length of a fixed array
Which operation is slow in an array but fast at the head of a linked list?
What does a map (dictionary) store?
What is the max-heap property?
A queue is implemented with two stacks: push onto an "in" stack, and pop from an "out" stack, refilling it from "in" when empty. What is the amortised cost per operation?
In a binary heap stored in an array starting at index 0, where is the parent of the node at index i?
The keys 50, 30, 70, 20, 40 are inserted in this order into an empty binary search tree. What is the left child of 30?
A segment tree is typically used to:
The time complexity of decrease-key in a binary heap (given the element's position) is:
Full step-by-step solutions: practise this topic on examproblems.com.