Answered step by step
Verified Expert Solution
Question
1 Approved Answer
intro computer science C++ program only (show complete code and output, the sorted array segments and the minimum maximum and median values of the input
intro computer science C++ program only (show complete code and output, the sorted array segments and the minimum maximum and median values of the input data)
Sorting very large arrays using techniques such as bubble sort or insertion sort may turn out to be prohibitively time consuming. One approach often used to sort large arrays is to divide the array into a number of smaller segments which are then sorted. The sorted segments are subsequently merged in the proper overall order. In this QUIZ, you are required to develop a C++ program, as follows: a. Implement a function void bubbleSort (int Arrayll, int first, int last) bubbleSort sorts the elements of Array in ascending order. Here first and last are, respectively, the indices of the first and last elements of the array segment to be sorted. In the event that the full array is sorted, we set first = 0 and last =N-1, where N is the size of Array Given an array Array of size N, divide the array into two segments of equal or nearly equal lengths N, and Nat N, +N2 = N. Using the function bubbleSort, sort the two array b. segments in ascending order. Find the minimum, maximum, and median values of the input data. c. d. Test your program using the input data shown. Input data N 100 : 200 457 1152 $18 4788 7 253,4 63 36 48i 450 90 380 35 452 34 196 31a 142 260 143 220 483 392 443 488 79 234 68 150 356 496 69 88 177 12 288 120 222 270 441 422 103 321 65 316 448 331 117 183 184 128 323 141 467 31 172 48 95 359 239 209 398 99 440 171 86 233 293 162 121 61 317 52 54 273 30 226 421 64 204 444 418 275 263 108 10 149 497 20 97 136 139 200 266 238 493 22 17 39] Expected output: Left segment: 12 35 46 65 68 69 74 79 88 90 103 117 120 142 143 150 157 160 177 183 187 196 220 222 234 252 270 288 312 316 318 321 331 356 364 390 392 406 415 422 441 443 448 450 452 472 481 483 488 496 Right segment: 10 17 20 22 30 31 39 48 52 54 61 64 86 95 97 99 108 121 128 136 139 141 149 162 171 172 184 200 204 209 226 233 238 239 263 266 273 275 293 317 323 359 398 418 421 440 444 467 493 497 Minimum: 10 Maximum: 497 Median: 202Step by Step Solution
There are 3 Steps involved in it
Step: 1
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