Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Apataras
Copy link

@Apataras Apataras commented Nov 7, 2025

Correct the number of merge operations in the time complexity explanation.

Correct the number of merge operations in the time complexity explanation.
@mhayter
Copy link
Contributor

mhayter commented Nov 8, 2025

Does it actually get called n-1 times. It seems like it would be called fewer since it's not called on leaves. I'm not sure if there's an exact way to express it. Perhaps we should just use big O.

@Apataras
Copy link
Author

Apataras commented Nov 8, 2025

A full binary tree with n leaves (our case) has always n-1 internal nodes (2n-1 nodes in total). And since merge gets called for each internal node we have n-1 merge operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants