You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm learning how to implement heaps. Your heap implementation is very well written, but can you tell me in the extractRoot(), if the pop root == _leaf, _leaf will be the last node in _nodes, can it be directly assigned to null? What scenarios need to be assigned as this.root()?
next question, sort() will return a list in reverse order, and it mutates the node positions in the heap. This can be prevented in the code, can you tell me what you think?
Although it is a minor issue, I look forward to your reply, I would appreciate it. And I will provide a pr if necessary.
The text was updated successfully, but these errors were encountered:
Hi, I'm learning how to implement heaps. Your heap implementation is very well written, but can you tell me in the extractRoot(), if the pop root == _leaf, _leaf will be the last node in _nodes, can it be directly assigned to null? What scenarios need to be assigned as this.root()?
next question, sort() will return a list in reverse order, and it mutates the node positions in the heap. This can be prevented in the code, can you tell me what you think?
Although it is a minor issue, I look forward to your reply, I would appreciate it. And I will provide a pr if necessary.
The text was updated successfully, but these errors were encountered: