Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please using c++ ( I need to cpp.file) visual studio 2015. please show me for code output and give to pseudo code for c++ thanks.

please using c++ ( I need to cpp.file) visual studio 2015. please show me for code output and give to pseudo code for c++ thanks.

please how to show your output.image text in transcribedimage text in transcribed

LSTest.txt

79 17 11 10 41 26 43 30 55 39 43 48 11 42 10 103 43 55 88 77 33 23

LSStandard.txt

43 104 51 64 75 11 54 62 67 39 97 57 19 25 67 93 77 29 17 29 103 82 12 93 39 11 109 36 83 78 67 43 85 55 88 106 37 49 44 25 82 30 76 99 79 20 63 88 68 83

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions