+ 1
Use the binary heap to return the k elements from largest to smallest
I did code below. I started to build the maxHeap first and then removeMax. After that i stored it into an array from root, which is the largest element to smallest then I returned the k elements largest. However, it said the error from line "Word result = wordArray[0];" in removeMax() method. Could someone help me to fix it? https://code.sololearn.com/cqU80EohWkt0/#java
2 Answers
0
Tuyen Pham Check your link, its not a valod code link
0
i fixed this @KrOW
Hot today
Python — File Handling
0 Votes
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
1 Votes
Help me solve this (using loop)
1 Votes
What is wrong? Error on test.
1 Votes
Help me wiht python
1 Votes
?
0 Votes