Github user ScrapCodes commented on the pull request:

    https://github.com/apache/spark/pull/2093#issuecomment-53378259
  
    > Only for N (top) > S (total), nsmallest() will sort, it's faster than 
heap, because it's implemented in C.
    
    My point was MaxHeap implementation does not need to sort. For Most values 
it may just replace the top. Or at worst logN swaps. ? But I think even though 
sort is C based implementation, it would be NlogN (at best). My python 
knowledge is definitely limited. I will be happy to be corrected. 
    
    > btw, MaxHeapQ is actually a min heap, why we call it MaxHeapQ ?
    From what I have learnt, MaxHeap keeps largest  element at top. ? Is that 
wrong ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to