Question: Please help with code and text file, C++ Program 1 - Linear Search Algorithm In Computer Science, it is often very important to be able
Please help with code and text file, C++


Program 1 - Linear Search Algorithm In Computer Science, it is often very important to be able to locate a specific data item inside a list or collection of data. Algorithms that perform this function are called searching algorithms and there are many such algorithms in Computer Science Although it is inefficient, one of the most common searching algorithms is called Linear Search In Linear Search we have a set of data that serves as the standard, usually stored within an array, and a separate value that we are searching for within that data set. We'd like to know whether the value is within the data set, so we scan through the data set looking for it, one element at a time, starting at the beginning of the array and proceeding, if necessary, to the very last element If the value is found within the standard array, we return a number indicating its index position within the array. If the value is not found, we return an error indicator, oftentimes a -1, that indicates the value was not in the data set For this problem, please implement a linear search algorithm that performs this function. You will be given two input files, "LSStandard. txt" and LSTest. txt", The LSStandard. txt file contains integer values against which we are searching. (There will be no more than 100 of these.) The LSTest.txt file contains a set of numbers that we are trying to locate within the standard data set. (There will be no more than 50 of these.) Read both of these into separate arrays and then determine which of the numbers in the LSTest file are included in the LSStandard data set by using a Linear Search algorithm. Have your program print out a report (to the console only is sufficient) that indicates whether the number was found or not. Your output should look something like Number 1 79) was located at index 44 Number 2 74) was not in the file. Number 3 56) was not in the file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
