You are on page 1of 4

CS 201 Data Structures – Binary Search Trees Discussion Tutorial

1)
a) A - root node / parent node of B and C
B - non leaf node / left child node of A / parent node of D and E
D/E/F - leaf nodes

b)

c) Best case - o (log n)


Worst case - o(n)

2)
a) Inorder - D , B , E , A , F , C , G
Preorder - A , B , D , E , C , F , G
Postorder - D, E , B , F , G , C , A
b) I.

II.

III.

OR
c) 34 11 56 45 78

3)
a)

Preorder traversal - 67 34 24 23 51 62 76 98
b)

OR

You might also like