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
Describe an abstract class 'Bank' having abstract methods as 'CreateAccount' 'depositAmount' & 'withDrawAmount'.Add method definitions for 'CalculateInterest' and 'SetInterest' as

The idea behind inline functions is to insert the code of a known function at the point where the function is called. If done carefully, this can improve the application's performa

Explain about the Voice recognition system These voice recognition systems recognise spoken words e.g. for disabled people who can't use keyboards where they speak commands rat

stepper motor interfacing 8255

In an ASP.NET web application that does not build use of routing, an incoming browser request should map to a physical file. If the file does not exist, we get page not found error

Question: (a) (i) Explain what do you understand by Client/server architecture? (ii) List and briefly describe 3 types of Client/server architecture. (b) The most impo

what is linear model and its type

Q. Show the Divide and Conquer approach? Divide and Conquer approach is the way of making a complicated problem easier.  In this approach larger problem (System) is divided int

Q. What is CODE SEGMENT? The logical program segment is termed as code segment. When linker links a program it makes a note in header section of program's executable file defin

The Signalling connection control part (SCCP) and message transfer part (MTP) together are referred to as (A) Signal Switching Points (SSPs) (B)  Signal Transfer Points