I will check and let you know ASAP.
let me know the deadline
Let me know if you can help me with this.
Can you provide any example you have about extraction and division?
Let me look
Creating a hashing function by division simply means we will use the remainder of the key divided by some positive integer p as the index for the given element. It can be defined as:
Hascode (key) = Math.abs(key)%p
and extraction method?
Also can we use Java API's Hash Table or we will be writing ?our own
Yes, we can use that. I am looking for the extraction method.
As for Extraction, I see that it is the process of extracting the hash key from the value of the element.
I will try to do it and let you know in few hours
Ok. I will try to find an example of extraction.
I see that extraction involves using only a part of the element's value or key to compute the location at which to store the element.
Thank you. please wait for 30 minutes
I am lost at:
As searching of java API is done using get method and it will return the value in 1 comparison
Could you provide any classroom example?
We didn't have any examples in class. I am thinking that maybe it only takes 1 comparison to find the original data
Yes. it will take only one comparison
Should I code in that way?
so, if 1 comparison is only necessary to find each item in each table, is the total number of comparisons necessary to find items in the table also 1
it will be equal to the number of elements as if there are 10 elements to search, you will need to make 10 comparisons. Does it make sense?
yes, i got it now.
ok. Should I go for coding?
or you wanted only this answer?
i need the number of comparison necessary to find each item in each table, the total number of comparisons necessary to find the items in each table, and the average number of comparisons necessary to find an item in each table
the number of comparison necessary to find each item in each table =1the total number of comparisons necessary to find the items in each table =40 the average number of comparisons necessary to find an item in each table = 1
As there are 2 tables with 40+40 items:the total number of comparisons necessary to find the items in both table =80
Let me know if anything else is needed
that is it. the program is just basically comparing the 2 tables so the program will have 2 sets of results, 1 for each table
Do you need code also?
Download code from here UsingHashTable.java
This is what I could understand from the question text
how do i get the program to show the number of comparisons for each table
also the average number of comparisons to find an item in each table
let me check
Here is modified code UsingHashTable.java
let me know if it suits you
Thanks a lot
You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant and fresh answers.It will ensure that question is for me. If you’re a subscriber, you can ask other questions from me at no additional cost beyond your monthly payment. Please bookmark my profile page:http://www.justanswer.com/computer/expert-logicpro/ so you can come back and ask me a question anytime. If my answer is helpful, please leave a positive feedback/bonus after clicking ACCEPT or ask me if you need more information.