Question 3
(a) Given Tree Y:
Tree Y
Based on Tree Y, find the followings:
i) Parent of P
ii) Sibling of W
iii) Ancestors of N
iv) Internal vertices
(b) Given Tree Z:
17
38
29
54
43
Tree Z
71
84
99
Based on Tree Z, list the order in which the vertices are processed using:
i) Pre-order traversal
ii) In-order traversal
iii) Post-order traversal
(c) Insert the following values (in the order given) into an empty binary search tree:
M, I, S, C, O, N, C, E, P, T, I, O, N, S
(1 mark)
(1 mark)
(2 marks)
(2 marks)
(4 marks)
(4 marks)
(4 marks)
(7 marks)
(Total: 25 marks)