Skip to content

MergeSort space complexity #505

@ERGeorgiev

Description

@ERGeorgiev

Describe the bug
The MergeSorter describes its space complexity as "space complexity: O(n)," in the comment above, but to me it seems more like it's O(n log n), as the code is creating new arrays with the same amount of data as the initial array on each split level. So N being the size of the initial array, multipled by log N for each split level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions