What is wrong in my code?
Heap: Heap Sort
you are printing the array from 1 to i<n
so only n-1 elements will be printed
Correct one
for(int i=1; i<=n; i++){
cout<<v[i]<<" ";
}
What is wrong in my code?
you are printing the array from 1 to i<n
so only n-1 elements will be printed
Correct one
for(int i=1; i<=n; i++){
cout<<v[i]<<" ";
}