Zero To DSAZero To DSA
Privacy Policy·Support on Ko‑fi
Quadratic vs Linear

Space Complexity Analysis

medium

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.