Insert 50, 30, 70, 20 into an empty BST. Where is 20?
- 50 is the root.
- 30 < 50: left child.
- 20 < 50 and 20 < 30: left child of 30.
Answer Left child of 30
A-level Computer Science revision · Data structures and algorithms
A graph has nodes connected by edges, which may be directed or weighted. A tree is a connected graph with no cycles and a root. In a binary search tree, each node's left subtree holds smaller values and right subtree larger ones. A hash table uses a hash function to map keys to positions, giving fast lookup; collisions are handled by chaining or open addressing.
Watch out A collision is when two keys hash to the same position; it must be resolved.
Insert 50, 30, 70, 20 into an empty BST. Where is 20?
Answer Left child of 30
A hash function is key MOD 10. At which index is key 47 stored?
What is a collision in a hash table?
Which structure has no cycles and a single root?
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.