Language is C++ Lab10B: Binary Bubbles. Binary search is a very fast searching algorithm, however it requires a set of numbers to be sorted first. For this lab, create an array full of 11 integers which the user will generate. Like in the previous lab, assume that the values will be between -100 and +100. Then, using the sorting algorithm called BubbleSort, put the array in the correct order (from lowest to highest number). After this, please print the array to the screen. Finally, search the array for the target value using Binary Search. The BinarySearch code will implement the algorithm described in the lecture slides. During this, you should print out a few key values which help Binary Search function. For example, this algorithm focuses on a low, mid, and high which correspond to the indices in the array the algorithm is currently considering and searching. Printing these values during the search process will help with debugging and fixing any issues. • BubbleSort sorts the array to prepare for the next step • BinarySearch searches the now sorted array to determine if the target value is in the array or not I included some sample outputs; the user input is in bold (just examples)
Language is C++
Lab10B: Binary Bubbles.
Binary search is a very fast searching
For this lab, create an array full of 11 integers which the user will generate. Like in the previous lab, assume that the values will be between -100 and +100. Then, using the sorting algorithm called BubbleSort, put the array in the correct order (from lowest to highest number). After this, please print
the array to the screen. Finally, search the array for the target value using Binary Search.
The BinarySearch code will implement the algorithm described in the lecture slides. During this, you should print out a few key values which help Binary Search function. For example, this algorithm focuses on a low, mid, and high which correspond to the indices in the array the algorithm is currently considering and searching.
Printing these values during the search process will help with debugging and fixing any issues.
• BubbleSort sorts the array to prepare for the next step
• BinarySearch searches the now sorted array to determine if the target value is in the array or not
I included some sample outputs; the user input is in bold (just examples)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images