Zero To DSA
Progress
C#
Back to Big O & Complexity problems
Quadratic vs Linear
Space Complexity Analysis
medium
Mark Solved
Time:
O(n)
Space:
O(n)
What is the space complexity (excluding input) of this function?
Examples
Input:
n = 5
Output:
O(n)
A new array of size n is allocated.
Hints
Reference Solution (CSHARP)