Basic Data Structures Flashcards
7 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Basic Data Structures flashcards as text
What is the height of a complete binary tree with n nodes?
Answer: O(log n)
A complete binary tree fills levels from left to right, giving a height of ⌊log₂ n⌋, which is O(log n).
In a hash table using chaining, what data structure is typically used for each bucket?
Answer: Linked List
Chaining stores colliding keys in a linked list at each bucket, allowing dynamic growth.
What is the worst-case time complexity for search in a Binary Search Tree (BST)?
Answer: O(n)
In a degenerate (unbalanced) BST that resembles a linked list, search degrades to O(n).
Which traversal of a BST visits nodes in ascending sorted order?
Answer: Inorder
Inorder traversal (left → root → right) of a BST visits nodes in non-decreasing sorted order.
What is the load factor in a hash table?
Answer: Number of elements divided by table size
Load factor = n/k, where n is the number of stored entries and k is the number of buckets.
In a max-heap, the root node always holds:
Answer: The maximum value
A max-heap maintains the property that every parent is greater than or equal to its children, so the root is the maximum.
Which of the following operations is NOT efficiently supported by a standard hash table?
Answer: Find minimum element
Hash tables don't maintain order, so finding the minimum requires scanning all elements — O(n).