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

Dont understand help please What is the order that the nodes values are included

ID: 3834116 • Letter: D

Question

Dont understand help please

What is the order that the nodes values are included in the following recursive function? b] Nodes evaluated in a BST search for a specified value: For the above example of Binary Search Tree, show the order that nodes are evaluated in searching for X. You do not need to include any node that is NULL. Select all that apply from a list and put the evaluation order in the box next to it. Node Order 0017 1 means evaluate the node with a key value of 0017 first. The BST is here, we want to search X=0009:

Explanation / Answer

1. Question here is to list out the order of nodes visited while in recursive function. How do we traverse /visit each node in order to find required node.

2. Question here is to list out order of nodes visited in order to search for an element x. here x is 0009. Since this is BST , first node is 0017 and order is 1 .

since0009 is less then 0017 ,in binary search tree , if nodes smaller to current node lie in left sub tree and nodes greater than lie inright sub tree , this property applies to all sub tress

by following above property, 0009 lies in left subtree of 0017 ,we visit node left to 00017 ,let it be y and now order becomes 2. similarly compare 0009 with Y , if 0009 > Y , visit right right child of Y , else visit left child and compare.

Do this until you reach 0009 in BST and every time you visit a node ,increase order by 1.

This is the procedure. if possible post entire question with structure of BST ,i will solve it.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote