Question: Linear Search Algorithm. create a random list (array, no duplicates) randomize a search item to be found in the list sequentially search the array for

Linear Search Algorithm.

create a random list (array, no duplicates)

randomize a search item to be found in the list

sequentially search the array for that item. You must code the search and not use a search function.

Display each comparison in the array; the element contents and the index.

display whether the item was found or not.

Now take that code and alter it to have two lists.

Both lists randomize between 1 and 50.

While traversing one list, use the linear search to compare each element of list 1 to list 2.

Display the element from the first list and whether it matched the element from the second list.

Rubric

Linear Search Algorithm

Linear Search Algorithm. create a random list (array, no duplicates) randomize a

Write a program that will 1. create a random list (array, no duplicates) 2. randomize a search item to be found in the list 3. sequentially search the array for that item. You must code the search and not use a search function. 4. Display each comparison in the array; the element contents and the index. 5. display whether the item was found or not Now take that code and alter it to have two lists Both lists randomize between 1 and 50. While traversing one list, use the linear search to compare each element of list 1 to list 2 Display the element from the first list and whether it matched the element from the second list

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!