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 Remember, the file name should be Lab10B. 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 11 Mid is 5 Searching Low is 6 High is 11 Mid is 8 Searching The target is in the set.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C++ . Please make sure code has "Enter integer 1, etc" instead of allowing you to type integers without prompt.

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
Remember, the file name should be Lab10B.
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 1l: 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 11
Mid is 5
Searching
Low is 6
High is 11
Mid is 8
Searching
The target is in the set.
Page 3 of 4
Sample output #2
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 1l: 67
What is the target number: -5
The sorted set is: -99 -14 1 2 11 12 15 27 42 67 89
Low is 0
High is 11
Mid is 5
Searching
Low is 0
High is 4
Mid is 2
Searching
Low is 0
High is 1
Mid is 0
Searching
Low is 1
High is 1
Mid is 0
Searching
The target is not in the set.
Transcribed Image Text: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 Remember, the file name should be Lab10B. 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 1l: 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 11 Mid is 5 Searching Low is 6 High is 11 Mid is 8 Searching The target is in the set. Page 3 of 4 Sample output #2 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 1l: 67 What is the target number: -5 The sorted set is: -99 -14 1 2 11 12 15 27 42 67 89 Low is 0 High is 11 Mid is 5 Searching Low is 0 High is 4 Mid is 2 Searching Low is 0 High is 1 Mid is 0 Searching Low is 1 High is 1 Mid is 0 Searching The target is not in the set.
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
Remember, the file name should be Lab10B.
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 1l: 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 11
Mid is 5
Searching
Low is 6
High is 11
Mid is 8
Searching
The target is in the set.
Page 3 of 4
Sample output #2
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 1l: 67
What is the target number: -5
The sorted set is: -99 -14 1 2 11 12 15 27 42 67 89
Low is 0
High is 11
Mid is 5
Searching
Low is 0
High is 4
Mid is 2
Searching
Low is 0
High is 1
Mid is 0
Searching
Low is 1
High is 1
Mid is 0
Searching
The target is not in the set.
Transcribed Image Text: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 Remember, the file name should be Lab10B. 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 1l: 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 11 Mid is 5 Searching Low is 6 High is 11 Mid is 8 Searching The target is in the set. Page 3 of 4 Sample output #2 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 1l: 67 What is the target number: -5 The sorted set is: -99 -14 1 2 11 12 15 27 42 67 89 Low is 0 High is 11 Mid is 5 Searching Low is 0 High is 4 Mid is 2 Searching Low is 0 High is 1 Mid is 0 Searching Low is 1 High is 1 Mid is 0 Searching The target is not in the set.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education