help I have an exm tommorow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manarq8
    New Member
    • Dec 2009
    • 1

    help I have an exm tommorow

    plz help me in this Q

    Write a menu driven C program which allows to:

    Build a max heap from the user input (the input is an array of integers).
    Insert a new element in the max heap.
    Search a specific element in the max heap.
    Delete an element from the max heap.
    Sort the user input based on the max heap concept.
    Merge two max heaps where the two max heaps are built from the user input.
    Display a max heap in the screen as a tree representation.
  • RRick
    Recognized Expert Contributor
    • Feb 2007
    • 463

    #2
    You need to work out the design yourself, but the above description has broken the problem into its pieces. That's a good place to start.

    If you can use C++, then I suggest you use the STL vector object. It has built in methods for managing elements. There are also STL algorithms for sorting and merging vectors.

    Comment

    • MyRedz
      New Member
      • Jan 2007
      • 17

      #3
      you can also use stacks and queues
      there are in the data structure part of c++

      Comment

      Working...