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
It is a mixture of hardware and software to perform needed task

Write a CGI program that displays a count of how many times a browser on each computer has contacted the server. echo Content -type: text /html echo N=$QUERY_STRING Ec

Give the formula for the average access time experienced by the processor in a system with 2 levels of caches. Ans: Formula is for the average access time experienced by the pr

Question 1: You want to perform the task of setting an alarm on your mobile phone. You can assume that the alarm option is accessible from the main menu of your phone. (a) P

Visual basic is useful if you are planning to make the programs from scratch. This language helps you in producing Active x controls, exe files, etc. Visual script is a powerful t

Determine about the blocking suspicious behaviour The response could be spontaneous and automatic, with an option to generate the alert message manually. The history recorded i

What is non-repudiation? how can it be achieved in designing e-cash based system?

Refining the Ratio Analysis Basically, refinement leads to purity. Thus to get a cleaner, more understandable and consistent design need to iterate analysis process.  R

What is macro call? Explain. Macro call: While a macro name is used along with a set of actual parameters this is replaced through a code generated from its body. Such code

What is guard bits? Guard bits are extra bits which are produced while the intermediate steps to yield maximum accuracy in the final results.