Homework Solution

Priority Queues

Problems to be Submitted (20 points)

  1. (8 points)

    tree

  2. (2 points)

    tex2html_wrap1365

  3. (10 points)

    We will highlight the downheap bubbling which took place at each stage.

    Here is the original heap:

    tabular15

    After first call to removeMin() (which removes '3'):

    tabular73

    After second call to removeMin() (which removes '6'):

    tabular146

    After third call to removeMin() (which removes '8'):

    tabular276

    After fourth call to removeMin() (which removes '9'):

    tabular406

    After fifth call to removeMin() (which removes'11'):

    tabular536


Last modified: Tuesday, 01 May 2012