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

Fill in the missing Java code by following the instructions below in bulletpoint

ID: 3776946 • Letter: F

Question

Fill in the missing Java code by following the instructions below in bulletpoints.

Search 2D (Table) Binary Tree To access a 2D array you need 2 indexes, e.g. array2d[row][column] The key will be in column 0, the left child index in column 1 and right child index in column 2 The 2D array/table thetable contains a binary tree with the root at row = 0; Write a while loop to search for the value in the variable akey Write an if-else to change the variable row to search the left or right child When the loop completes row must be the slot that equals variable akey Do not declare the variable row, but do initialize and change it during the search. Implement the instructions above by placing your Code here: row =; while () {if () {} else {}}

Explanation / Answer

row = 0;
while (thetable[row][0] != akey){
if(thetable[row][0] < akey){
       row = thetable[row][2];//right child
}
else {
       row = thetable[row][1];//left child
}
}

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