What does the peek (or top) operation on a stack do?
- AReturns the bottom element of the stack
- BRemoves all elements from the stack
- CRemoves the top element and returns it
- DReturns the top element without removing it
What does the peek (or top) operation on a stack do?
In an adjacency list representation of a graph, what is stored for each vertex?
What is the load factor of a hash table?
How long does a search for a word of length L take in a trie with a fixed alphabet?
A binary tree has root 1 with left child 2 and right child 3; node 2 has children 4 (left) and 5 (right). What is the preorder traversal?
In a circular queue stored in an array of capacity n, how is the next position after index i computed?
Under simple uniform hashing, what is the expected time of a search in a hash table with chaining, n keys and m buckets?
What is the running time of breadth-first search on a graph with V vertices stored as an adjacency matrix?
Full step-by-step solutions: practise this topic on examproblems.com.