0
I need help with my code Heap Sort JavaScript
Something is wrong with the computation, seems It prints out the first number in the array the amount of integers in the arry. And how would I make it for user input via text box not alert https://code.sololearn.com/W8wmrIRuZfi3/?ref=app
4 Antworten
+ 1
I believe the only problem is that the swap function needs a slight adjustment.
Change line 45 from
input[index_A]= input[index_B]= temp;
To
input[index_A]= input[index_B];
input[index_B]= temp;
+ 1
It worked😛
Alright, thanks a bunch
+ 1
You're welcome!
0
Thank You, I will look that up.