Question 7

OCR Computer Science June 2025 Algorithms and programming (H446-02)A level9 marks

On the specification

(a)
2.3 Algorithms1.4 Data types, data structures and algorithms
(b)
1.4 Data types, data structures and algorithms2.3 Algorithms
(c)
2.3 Algorithms1.4 Data types, data structures and algorithms
Question text

7 An ordered binary search tree contains the following data: 50 16 55 75 8 45 51 60 88 20 47 (a) Add the following data items in the given order to the binary search tree above. 5 30 53 57 90 [3] (b) A balanced binary search tree has data consistently at each level, for example: An unbalanced binary search tree is uneven, for example: Describe the drawback of an unbalanced binary search tree when searching for a value. [2] (c) A different binary search tree stores the following data: 100 35 402 20 75 220 600 80 450 602 Give the output that will be produced from a depth-first (post-order) traversal and a breadth-first traversal of this binary search tree. Depth-first (post-order) Breadth-first [4]