Computer systems June 2024, Question 8 10 marks
Write a line of program code or pseudocode to declare the array towns.
Reveal mark scheme
In the 2-dimensional array towns:
• the first column contains a pointer to the left side
• the second column contains the data
• the third column contains a pointer to the right side.
Leaf nodes have the pointer null. Complete the table showing the contents of the towns array to store the binary search tree shown in Fig. 8.
Reveal mark scheme
Four more towns are added to the binary search tree shown in Fig. 8 in this order:
Mallow
Cavan
Tuam
Wexford
Complete this binary search tree by adding the new towns to it.
Reveal mark scheme