Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

100 / \\ 80 150 / \\ / \\ 10 90 120 500 / \\ / / \\ 5 20 85 115 130 \\ / 88 125

ID: 3761356 • Letter: 1

Question

    100

   /           

80          150

/             /      

10    90   120   500

/      /    /   

5 20 85 115 130

                    /

        88       125

Give the nodes in the search path when we search for the keys below:

a) key 85: _________________________________________________________

b) key 127: _________________________________________________________

- Write the keys in the order they are traversed when we perform the following traversals:

a) Pre-Order: ________________________________________________________

b) In-Order: _________________________________________________________

c) Post-Order: ________________________________________________________

d) Level-Order: _______________________________________________________

Explanation / Answer

Key 85 : 100,80,90,85

key 127 : 100,150,120,130,not found

Pre-order - 100 80 10 5 20 90 85 88 150 120 115 130 125 500

In-Order - 5 10 20 80 85 88 90 100 115 120 125 130 150 500

post-order - 5 20 10 88 85 90 80 115 125 130 120 500 150 100

level order - 100 80 150 10 90 120 500 5 20 85 115 130 88 125