Search code examples
algorithmbig-ospace-complexity

Space Complexity of an algorithm when no extra space is used


Consider an algorithm that uses no extra variables except the given input.

How to represent the space complexity in BigO Notation?


Solution

  • O(1)

    Where it requires a constant amount of additional space namely 0.