Question: Using C++, implement the Probabilistic Sequential Search. INPUT FORMAT Your program must read inputs from a file. The first line contains the number N which

Using C++, implement the Probabilistic Sequential Search. INPUT FORMAT Your program must read inputs from a file. The first line contains the number N which tells the number of elements in the list. The next line contains N number of integers. OUTPUT FORMAT Your program must prompt the user to enter the target or item to search. Your program will process the input and outputs the location of the target in the list, if found. If not found, display 'item not found'. Then, display the list of the array. See sample output. Note: The program must continue asking input until the user quits the program. Sample Input 10 5 4 6 10 9 199 -1 0 3 45 Sample Output Enter target: 10 Target found at location 3. Updated List: 5 4 10 6 9 199 -1 0 3 45 continue> [y/n] : y Enter target: -1 Target found at location 6. Updated List: 5 4 10 6 9 - 1 199 0 3 45 continue> [y/n] : y Enter target: -1 Target found at location 5. Updated List: 5 4 10 6 - 1 9 199 0 3 45 continue> [y/n] : y Enter target: -1 Target found at location 4. Updated List: 5 4 10 - 1 6 9 199 0 3 45 continue> [y/n] : n What to upload 1. Source Code 2. Test Files 3. Documentation of the source code including the efficiency analysis of the entire program (f(n) and O(n)).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!