Skip to content

Insertion Sort Spatial Complexity #52

@jamestrenda

Description

@jamestrenda

What about spatial complexity? O(1)! We don't create any additional items for this sort.

The proposed solution creates a variable, let numberToInsert = nums[i] inside the outer for loop. Wouldn't that mean the spatial complexity is O(n)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions