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

Octobe 17, 21 1 Tree traversal Given T, Ll inary L: .. and two trtz walk algorit

ID: 3727772 • Letter: O

Question

Octobe 17, 21 1 Tree traversal Given T, Ll inary L: .. and two trtz walk algorithms, that bm arial the rode keys alatg the way: 2 xroot x x.ieft RRwx.rigt elseif x.IL 7RWALK.left listed POP(S Pinlisted keyl PutHIS, listed. runs x sted. right elws x.rignt 19,12,9,3, 13, 15, 18, 21,67,34,20 3,13,9, 18, 15, 12,21,34,70,67,43, 19 3,9, l3, 12, 15, 18, 19, 21,13,34,47,70 19,12,43,9. 15,21,67,3.18.34.70 bl ]?,43,67,70.34, 21, 12, 15, 18,9, 13,3- 19,43, 12,6?,21.15,9,0,31, 1S13.3 2 Binary Search Tree property Is the tee represented in exercixe (1 a ESI? Explain

Explanation / Answer

Answer is as follows:

As indicate in ques, I will just provide answer of ques 2 :

Binary Search Properties :

The given binary tree is not Binary Search Tree.

Because right subtree of node 19 contains more than 19 values.

first it takes 43 and 21 as left and 67 as right subtree i.e. ok.

But after 67 the left subtree takes 34 i.e. <67 but also <43 but here it apears in right subtree.

But accordig to the rule all the values of right subtree of any node is greater than that node.

But here 34 is less than 43 and apears in right subtree of 43.

So the rule get false here

So e can say that the given Tree is not BST i.e. Bianry Search Tree.

if there is any query please ask in comments...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote