Implement a priority queue, Computer Engineering

1. Insert the following characters with their respective priorities (shown as ordered pairs) into an empty treap:

(K, 17), (F, 22), (P, 29), (M, 10), (N, 15), (L, 26), (G, 13), (X, 20), (A, 44), (P, 19), (Q, 30).

Show the result after each insertion.
2. Given a Skiplist with probability p and maximum node size M that contains N nodes, show the expected distribution of node sizes (how many nodes of each size).
3. How would choosing a large value (close to 1) of p or a small value (close to 0) affect the performance of a skiplist? Justify your answer.
4. Insert the values 89, 19, 50, 59, 76 and 26 into an empty hash table of size 11 that uses f( k ) = k mod 11 for its hash function and linear probing using f( i ) = i for collision resolution. 

5. Is a hash table a good choice to implement a priority queue? Justify your answer.

Posted Date: 2/14/2013 1:58:58 AM | Location : United States

Related Discussions:- Implement a priority queue, Assignment Help, Ask Question on Implement a priority queue, Get Answer, Expert's Help, Implement a priority queue Discussions

Write discussion on Implement a priority queue
Your posts are moderated
Related Questions
Locality of reference implies that the page reference being made by a process is Ans. Locality of reference means that the page reference being made through a process is proba

What are the process states in Unix? As a process implements it changes state according to its circumstances. Unix processes have the following states: Running : The process

Automatic correlation from web point of sight can be set in recording options and correlation tab. Here we can enable correlation for the whole script and choose either issue onlin

What are the two independent mechanisms for controlling interrupt request? At the device end, an interrupt enable bit in a control register verifies whether the device is permi

What are assembler directives? Ans: These are the instructions that direct the program to be executed. They have no binary corresponding so they are called pseudo-opcodes. The

Paging Unit Paging mechanism functions with 4K - byte memory pages or with a new extension available to Pentium with 4M byte-memory pages. In the Pentium, with the new 4M-byt

Give an account of the issue pertaining to compilation of if statement in C language Control structures as if cause significant gap in between the PL domain and the execution d

What are Grouping Notations These notations are boxes into which a model could be decomposed. Their elements includes of packages, frameworks and subsystems.

Suppressing the number signs (+/-) is carried out using the addition NO-SIGNS to the Write statement.  Statement is wrong.

What do you call an event and when do you call an assertion? Assertion based Verification Tools, checks whether a statement holds a explained  property or not, while, Event bas