Hacker News new | past | comments | ask | show | jobs | submit login

It wasn't me who downvoted. I can't (since you responded to me) and wouldn't have anyway. If you use last then that means the whole list will have to be sorted O(n log n ish) then the last element retrieved. And yes, I'm assuming a merge sort. But I still don't think that detracts too much from my point.



Could you please s/max/min/ in your first post?


But it depends on the sort algorithm. In the exercise I did this on (in Ocaml with some custom lazy code, since Ocaml's wasn't lazy enough for what I was doing) I did sort in descending order.


Are you saying you made a sort function that sorts reversed, and named it sort? What's wrong with sortDesc?

I think you should be more careful with following conventions. Everyone knows sort sorts ascending.


Conceded. But I can't edit my original comment now. :(




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: