Question: Given the following, demonstrate how the Binary Search method of searching an array will work. At each step, you should list the array slot (index)
Given the following, demonstrate how the Binary Search method of searching an array will work. At each step, you should list the array slot (index) that is checked, and what this you. Note that you may or may not need all of the passes printed below. Note also that you should not use any optimizations beyond was what covered in the pseudocode for the standard Binary Search. Demonstrate what the algorithm does, when it's asked to find "3" in the following array: Iteration # 1: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you? Iteration # 2: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you? Iteration # 3: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you? Iteration # 4: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you? Iteration # 5: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you? Iteration # 6: Index of min element in the current range: _____ Index of Max element: ______ Array index checked: ______ (Value at that index: ______) What does this tell you?_________________
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
