Design an application that creates a file named numbers.txt populated with 100 random integers 1-100. The program should
Posted: Fri Jul 08, 2022 6:15 am
Design an application that creates a file named numbers.txt populated with 100 random integers 1-100. The program should read and assign all the numbers stored in numbers.txt to an array. Next the program should call a function that uses the selection sort algorithm to sort the array. Then the program should call another function that uses the binary search algorithm to locate a value in the array. It should also keep a count of the number of comparisons it makes. Sample program run #1 with input shown in bold: Enter number to find (1-100): 86 For binary search, number of comparisons: 100 Search failed. Sample program run #2 with input shown in bold: Enter number to find (1-100): 86 For binary search, number of comparisons: 90 Number is found at position: 89 Sample program run #3 with input shown in bold: Enter number to find (1-100): 29 For binary search, number of comparisons: 33 Number is found at position: 32 Sample program run #4 with input shown in bold: Enter number to find (1-100): 29 For binary search, number of comparisons: 26 Number is found at position: 25