ps5 - j ) with NUMBER( k ). If NUMBER( j ) NUMBER( k ),...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem Set #5 IE 495 Due October 30, 2000 Written Problems 1. Prove that in a binomial heap, the amortized running time for an insert operation is O(1). There is an argument for this in the reading by Kozen and we also discussed it in class. You should give a more detailed proof that shows you understand the conept of amortized analysis. The proof approach we discussed in class is a little more rigorous and straightforward than the one in Kozen. You might try to use this approach. 2. Another way of solving the disjoint set union problem is as follows: Let NAME( i ) be the name of the set containing i , NUMBER( j ) the number of items in set j , and LIST( j ) a pointer to a linked list of the items in set j . The FIND( i ) operation can then be accomplished simply by examining NAME( i ). The UNION( j, k ) operation where j and k denote sets, is accomplished by first comparing NUMBER(
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: j ) with NUMBER( k ). If NUMBER( j ) NUMBER( k ), then Set NAME( i ) = k for all i in LINK( j ), Append LINK( j ) to LINK( k ) Increase NUMBER( k ) by NUMBER( j ) The new set is named j . Prove that for a total of n items, the time for all UNION operations is O ( n log n ). 3. Write an algorithm to delete an identifier from a hash table in which overflows are handled by linear probing (see Horowitz and Sahni, page 87). Programming Problems 4. This is a group problem. Each project group should only produce one code. Modify your code from the last assignment so that it performs component labeling. In other words, it should read in a graph from a file as a list of edges and print out the list of nodes in each connected component of the graph....
View Full Document

Ask a homework question - tutors are online