Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C# PLEASE Lab9B: Binary Bubbles. Binary search is a very fastsearching algorithm, however it requires a set of numbers to besorted first. Lab9B: Binary Bubbles.
C# PLEASE Lab9B: Binary Bubbles. Binary search is a very fastsearching algorithm, however it requires a set of numbers to besorted first.
Lab9B: 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 lab 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 Remember, the file name should be Lab9B. The user input is indicated in bold. Sample output #1 Please enter 11 numbers: Integer 1: 15 Integer 2: 12 Integer 3: 89 Integer 4: -14 Integer 5: 11 Integer 6: -99 Integer 7: 1 Integer 8: 42 Integer 9: 27 Integer 10: 2 Integer 11: 67 What is the target number: 42 The sorted set is: -99 -14 1 2 11 12 15 27 42 67 89 Low is 0 High is 10 Mid is 5 Searching Low is 6 High is 10 Mid is 8 Searching The target is in the set.
Step by Step Solution
★★★★★
3.40 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
C program that searches for an integer in an array using binary search using System class Lab9B static void Main create an array of size 11 int number...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started