Tuesday, March 13, 2012

C++ PROGRAM FOR PRIORITY QUEUE USING HEAP PROPERTY

8 comments:

  1. what is the use of below function:
    heap_min(data a[])
    int buildminheap()

    ReplyDelete
    Replies
    1. heap_min returns the min element of the heap and buildminheap builds a min-heap

      Delete
    2. whats the usage of heapincp(data a[],int i,int ps)

      Delete
    3. heapincp attaches a node in the heap in proper order checking the priority of node

      Delete
  2. when i try to compile this it returns the followed error:
    1>c:\users\admin\desktop\priority queue heap\priority queue heap\main.cpp(42): error C4716: 'minheapify' : must return a value
    1>c:\users\admin\desktop\priority queue heap\priority queue heap\main.cpp(58): error C4716: 'buildminheap' : must return a value
    1>c:\users\admin\desktop\priority queue heap\priority queue heap\main.cpp(74): error C4716: 'heapincp' : must return a value
    1>c:\users\admin\desktop\priority queue heap\priority queue heap\main.cpp(96): error C4716: 'min_heap_insert' : must return a value
    WHAT SHOULD I DO?? It will be very helpful if you respond and thanks a lot for the code

    ReplyDelete
    Replies
    1. I'd fixed those errors. You can try that now.

      Delete
    2. Thanks for your effort . But , I had the same issue..
      " error C4716: 'buildminheap': must return a value "
      Could you please help!!
      what should me the return value of buildminheap !!

      Delete
    3. buildminheap don't need to return any value, it is just a function to do heap sort on the full array

      Delete