What is the time complexity for hash table lookup?
O(1)
Name 2 collision resolution methods
Separate chaining (closed addressing), linear probing (open addressing)
What is the time complexity for linked list insertion after a particular node, or deletion of a specific node?
O(1)
What is the time complexity for linked list search?
O(n)
State three features of a good hashing algorithm
Name 2 Abstract Data Types.
Stack and Queue
What is a stack?
A stack is a last-in-first-out/first-in-last-out (FILO/LIFO) data structure.
The first element pushed onto the stack is the last element popped from the stack.
What is a queue?
A queue is a first-in-first-out (FIFO) data structure.
The first element enqueued is also the first element dequeued.
What methods are required for a Queue ADT?
Enqueue: add an element to the queue
Dequeue: get the next element from the queue
What methods are required for a Stack ADT?
Push: add an element to the stack
Pop: get the next element from the stack
What are the key features of a Circular Queue?
Circular queues have a fixed capacity.
The last location in the array wraps around to the first location.
What does a hash function do in a hash table?
Hash function takes an input key and returns a location/index of fixed size. The same input key is always hashed to the same location.