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

The code to answer exercise 9.1 is below; however, it is incorrect. What changes

ID: 3777647 • Letter: T

Question

The code to answer exercise 9.1 is below; however, it is incorrect. What changes do I need to make so that the value 38 is found in the variable "akey" at index 0?

Sorry incorrect, the value in akey 38 was NOT found in the array at index 0 Return to Exercise Close Window Your Code with color highlights added) index 0; while (index the array lengt if (akey thea inde array break else if key k the array[index] inde 2 index 1 else index 2 index 2; The Instructions: Exercise 9.1 Search ID Binary Tree Array The ID array thearray contains a binary tree with the root at index -0 Write a while loop to search for the value in the variable akey Write an ifelse to change the variable index to search the left or right child When the loop completes index must be the slot that equals variable akey Do not declare the variable index, but do initialize and change it during the search. Help Type this in first, then back up and fill it out: while f if else

Explanation / Answer

([x, x'], T)
    if T is a leaf node, then
        if x <= val(T) <= x' then
            return { val(T) }
        else
            return {}
        end if
    end if
    <else T is an interior node of tree>
    if x' <= val(T) then
        return FindPoints([x, x'], left(T))
    else if x > val(T) then
        return FindPoints([x, x'], right(T))
    else <interval spans splitting value>
        return FindPoints([x, x'], left(T)) union FindPoints([x, x'], right(T))
    end if

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