1.Write a program to implement the open addressing linear probing algorithm in JAVA or Python. Test your program with different sets of data and take screenshots for each test. Copy and paste your...

1 answer below »






1.








Write a program to implement the open addressing linear probing algorithm in JAVA or Python. Test your program with different sets of data and take screenshots for each test. Copy and paste your code and screenshots into a Word document along with your response to the following:








Perform an asymptotic analysis of your algorithm.











  • Did any collisions occur while testing your data?








  • How can you resolve the collisions?








  • Explain the technique you prefer to use to resolve the open addressing linear probing collision issues.


















The Portfolio Activity entry should be a minimum of 500 words and not more than 750 words. Use APA citations and references if you use ideas from the readings or other sources.











2.








Write a code to implement Binary Search Tree (BST). Test your program with the following data= [27, 5, 12, 85, 6, 19, 1, 8, 95, 3]. Traverse your BST as;









a) In-order






b) Pre-order






c) Post-order






Copy the code and screenshots of your output into a Word document and submit it as your Portfolio Assignment with your response to the following question:

























  • How do in-order, pre-order, and post-order differ from each other when we traverse BST data?











3.











  • Using a Word document, illustrate the Karp-Rabin algorithm on T= AABAACAADAABAAABAA and P= AABA. Be sure to show each step of the process in your illustration.




















Answered 2 days AfterDec 12, 2022

Answer To: 1.Write a program to implement the open addressing linear probing algorithm in JAVA or Python. Test...

Vikas answered on Dec 15 2022
32 Votes
Report
Part 1: Linear Probing (Java)
Code is attached in the LinearProbing.java file.
Output:
Q
. Perform an asymptotic analysis of your algorithm?
Ans: The complexity of code is:
Get(): O(n)
Put(): O(n)
Contains: O(1)
Q. Did any collisions occur while testing your data?
Ans: There are a lot of collisions which occurred and are shown in the output image above.
Q. How can you resolve the collisions?
Ans: By using the technique, whenever the collision occurs then make a linked list for that key containing all the values that are corresponding to that key.

Part 2: Binary Search Tree (Java)
Code is attached...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here