Merge Implementation Issue in Merge Sort #11434
Robertation256
started this conversation in
General
Replies: 1 comment 1 reply
-
Popping from the front can indeed be expensive for large lists. Bu int his case we are popping from the list which is referenced in the merge function which is called recursively thus it doesn't affect the overall time complexity. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think popping from the beginning of the list might be very expensive here and can cause the sorting complexity to deteriorate to O(n^2)
Beta Was this translation helpful? Give feedback.
All reactions