[Solved]-Python3 Create Linked List Implement Searching Algorithm Search S Values Part 1 Create Lin Q37282002
Python3,
Create a linked list and implement a searching algorithm tosearch through it’s values.
Part 1: Create a Linked List
Make a linked list that can accept any number of ints from theuser. Continue to ask the user for more integers until they saythey are done. [2 pts]
Ex.
Enter an integer value for your list:
12
Would you like to add more values? (“y” or “n”)
y
Enter an integer value for your list:
46
Would you like to add more values? (“y” or “n”)
n
Prompt the user for the value they would like to search for inthe list. Tell them if their value was found in the list or not.Continue to prompt them for more searches until they say they aredone. [2 pts]
Ex.
Please enter an integer value to search for in the list:
21
Sorry, your value, 21, was not found 🙁
Would you like to search for another value? (“y” or “n”)
y
Please enter an integer value to search for in the list:
46
Your value, 46, was found in the list! 😀
Would you like to search for another value? (“y” or “n”)
n
Part 2: Searching Algorithm
Choose a searching algorithm to program. [3 pts]
NOTE: you can use your class lecture material, zybooks and otherresources like GeeksForGeeks, etc., just make sure you understandit line by line, since you will be needing to comment on each line(see “Comments Required” below).
-Linear Search algorithm:
- Traverse the array using a for-loop.
- In every iteration, compare the target value with the currentvalue of the array.
- If the values match, return the current index of thearray.
- If the values do not match, move on to the next arrayelement.
- If no match is found, return -1.
-Binary Search algorithm:
- Start with the middle element:
- If the target value is equal to the middle element of thearray, then return the index of the middle element.
- If not, then compare the middle element with the target value,
- If the target value is greater than the number in the middleindex, then pick the elements to the right of the middle index, andstart with Step 1.
- If the target value is less than the number in the middleindex, then pick the elements to the left of the middle index, andstart with Step 1.
- When a match is found, return the index of the elementmatched.
- If no match is found, then return -1
Comments Required
To demonstrate that you really understand what is going on, youmust leave a comment on each line of your linked list code andsearching algorithm describing what is happening. We are fullyaware that you can get all the code you need online, so comments tohelp you and others understand what is going on is a key part ofthis lab. Also, as noted above, make sure to include in yourcomment block, which searching algorithm you are going to implementto search your linked list. [3 pts]
Thank you
Expert Answer
Answer to Python3, Create a linked list and implement a searching algorithm to search through it’s values. Part 1: Create a Link… . . .
OR

