Question: Write a program, Al_ID.cpp (e.g. A1_816004343.cpp) to: 1. Read 20 distinct integers from a file, input.txt. The data for input.txt is provided at the end
Write a program, Al_ID.cpp (e.g. A1_816004343.cpp) to: 1. Read 20 distinct integers from a file, input.txt. The data for input.txt is provided at the end of this assignment b. Store the numbers in an array, num1. c. Search the array using sequential search for the following values: 19 15 56 For each search count and display the number of comparisons performed to find the value. d. Sort the array using selection sort. e. On the sorted array, search for the following values using sequential search 19 15 56 For each search count and display the number of comparisons performed to find the value. f. On the sorted array search for the following values using binary search. 19 15 56 For each search count and display the number of comparisons performed to find the value. input.txt 14 2 3 7 5 6 19 18 17 16 15 86 38 35 34 26 95 101 100 56
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
