CSE374
Han Li
02/28/2021
Problem 1
Demonstrate the insertion of keys 5, 28, 19, 15, 20, 33, 12, 17, 10 into a hash table with collisions resolved by chaining. Let the table have 9 slots and let the hash function h(k) =k mod 9.
The hash table insertion of all 9 keys
i
T[i]
0
[]
1
[10,19,28]
2
[20]
3
[12]
4
[]
5
[5]
6
[33,15]
7
[]
8
[17]
Problem 2
Professor Marley hypothesizes that substantial performance gains can be obtained if we modify the chaining scheme so that each list is kept in sorted order. How does the professor’s modification affect the running time for the following.
Whatever Successful or Unsuccessful Searches will take time O(length).
Thus, if the factor is constant, the average time complexity of O(1) will not be changed.
Insertions: The insertion operation earlier took O (1), after that, it will take time O(length).
Deletions: For doubly linked list will take O(1), for single linked list will take time O(length).
Problem 3
Consider a hash table of size m = 1000 and a corresponding hash function h(k) = [m(kAmod1)] For A= (√5−1)/2. Compute the locations to which the keys 61, 62, 63, 64, and 65 are mapped.
The hash function is ℎ(?)=(?∗(?∗? ??? 1))
A= (√5−1)/2 is equal to 0.618, so we have following
ℎ(61)=(?∗(?∗? ??? 1)) =(1000∗(61∗0.618 ??? 1))=698 ℎ(62)=(?∗(?∗? ??? 1)) =(1000∗(62∗0.618 ??? 1))=316 ℎ(63)=(?∗(?∗? ??? 1))
=(1000∗(63∗0.618 ??? 1))=934 ℎ(64)=(?∗(?∗? ??? 1)) =(1000∗(64∗0.618 ??? 1))=552
ℎ(65)=(?∗(?∗? ??? 1)) =(1000∗(61∗0.618 ??? 1))=170
Problem 4
Suppose that n women check their coats at a concert. However, at the end of the night, the attendant has lost the claim checks and does not know which coat belongs to whom. All of the women came dressed in black coats that were nearly identical, but of different sizes. The attendant can have a woman try a coat, and find out whether the coat fits (meaning it belongs to that woman), or the coat is too big, or the coatis too small. However, the attendant cannot compare the sizes of two coats directly, or compare the sizes of two women directly. Describe how the attendant can determine which coat belongs to which woman unexpected O(n log n) time. Give a brief analysis of the running time of your algorithm.
We can use Quicksort to solve such problems. For ladies and coats, we only need to choose a lady, use her as the pivot, and then find out who is bigger and smaller than her to compare. Then continue to compare between the two separate categories, and finally find the result. ?(?)=?(?2)+∅(1) ?(?)=??(??)+∅(???????)
We have a=1,b=2,k=0,p=1 ?(?)=∅(????)
For n number of coats, we have ?(?)=∅(?????)
Order any type of Service We Provide
We are the best assignment service that can satisfy student’s demands in different scientific fields. We perform tasks of any kind. Our specialists provide diverse custom assignment writing services to students from all over the world every day. You can contact us for assistance with:
The list is far from complete!
Representatives of our student assignment service are connoisseurs of the peculiarities of presentation in regards to academics. Your college assignment will never turn out an untoward surprise! Whether you need research for high school, an undergraduate program, or a Master’s or Doctoral degree, you will get exactly what you are looking for to sound smart and well-informed.
If you are pressed for time, request our experts!
We are your academic saver. It is a perfect solution for people who need academic help but has no professionals nearby to provide it. Just redirect your home tasks to us and forget about any educational issues. With us, you will get 100% plagiarism-free content delivered on time by an experienced specialist in a particular field.
When you order professional assignments here, you will get:
Original custom papers. We value your academic reputation. Just as well, we value the years of thorough work on our reputation for reliability and never compromise the originality of delivered papers. We will never endanger both. Every custom assignment is written from zero – the only possible first stage of work on the order is research. We apply the latest plagiary checking tools on the final stage, so plagiarism has no chance to emerge in your college assignment writing.
Control over the order completion. To make the process of collaboration comfortable and efficient, we offer our clients to choose the writer themselves taking into account all the requirements and the budget. For you to save nerves, having entrusted your fateful task to some qualified “stranger”, we enable communication with the assigned writer in the process of order completion.
Affordable assistance. We are eager to contribute to the academic achievements of students in need of help with college assignments. We are eager to help you start investing in your career growth today. That is why our service is so affordable. We don’t charge to pay for the latest marketing tricks or advertisements – we choose the best experts in the labor market who write great custom papers in any area, level of complexity, and time frame. Our client’s grateful feedback is a top advertising trick.
On-time delivery. The quality of a paper is only valued when it is delivered within the determined time frame – you will get your custom assignment writing service in time and have a couple of days to revise it and ask for changes in case they are needed. And you will still have time to learn the material.
Protection. We value your trust and take all measures needed to keep your private and banking details safe. We offer only well-tested payment methods. Due to the system of encryption and protected servers, no third party can have access to your data.
Custom support 24/7. We do our best to make the process of collaboration comfortable for the customer. Our “write my assignment” help is always here for you to provide a solution to your problems, give you a prompt answer to any question, and offer clarification as to any issue related to the services. Feel free to contact us anytime!
If you feel that your dissatisfaction with student life is growing every day and you just feel exhausted, don’t hesitate to change the situation for the better today. Order your first assignment from reliable custom assignment services today to evaluate the advantages.
Having seen the difference once, you won’t want to go back to your previous lifestyle. You deserve to find fulfillment in other spheres of your life, have hobbies, spend time with close people but continue making progress. It is possible when you have a professional helper. Don’t put off your life for someday after graduation!
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more