954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

heap

plz help me in my algorithm to first enter data in array then making a min heap out of it

#include <iostream>
#include <stdlib>

using namespace std;

class Heap
{
      int currentsize;
      int *array;
      int capacity;
      void heapsort(int[],int);
      
public:
       void buildheap();
      void isempty();
       void isfull();
       int getsize();
       }
       
main()
{
      int a[100];
      int n;
      int i;
      cout<<"please enter the number of element u want to sort in heap:";
      cin>>n;
      cout<<"enter the number:";
      for(i=1;i<=n;i++)
             {
             cin>>a[i];
             buildheap();
                 }
                 }
sidra 100
Junior Poster
142 posts since Dec 2009
Reputation Points: 6
Solved Threads: 0
 

What problems are you experiencing now?

Duki
Nearly a Posting Virtuoso
1,475 posts since Jun 2006
Reputation Points: 817
Solved Threads: 32
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You