Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void showHeap(int A[]) {
- int index=1, align=39, j=0;
- gotoxy(39,19);
- int max=calculateMax(A);
- for (; index<=A[0]; index++) {
- max=generateLength(A[p(A[index])]);
- if (index>=pow(2,j)) {
- align=align - max;
- gotoxy(align,wherey()+1);
- j++;
- }
- else
- if ((index>2) && (p(A[index])) != p(A[index-1]))
- printSpacesAfterTheText(max-generateLength(A[p(A[index])]));
- printf("%d",A[index]);
- printSpacesAfterTheText(max);
- }
- printf("\n\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement