Timeline for Heap Sort in Scala
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 1 at 15:55 | vote | accept | Loki Astari | ||
Apr 9, 2019 at 16:18 | vote | accept | Loki Astari | ||
Apr 9, 2019 at 16:18 | |||||
Feb 1, 2017 at 16:48 | comment | added | Loki Astari | All your methods are public. I tried to hide members that were not useful to the public scope. Is that bad? | |
Feb 1, 2017 at 16:46 | comment | added | Loki Astari |
Thanks for the code couple of questions. Why do you use recursion instead of a loop in heapify() . In my code when getting the children I use a tuple and one call. You use two calls (left() and right() ). Is there a particular reason you choose to use two functions. Is my code bad practice or OK?
|
|
Feb 1, 2017 at 16:39 | comment | added | Loki Astari |
Consider this: loc=0;left=1;right=2; Now think about your definition of left() and right() . Your code is correct if you assume arrays are indexed from 1.
|
|
Feb 1, 2017 at 9:46 | comment | added | Mast♦ | You've presented an alternative solution without reviewing the code. On Code Review, all answers should contain a review. | |
Feb 1, 2017 at 9:00 | history | answered | Maheshwar Ligade | CC BY-SA 3.0 |