Yes, the exact same mathematical rules apply. Using 2 arrays of size N is O(2N) space, which simplifies to O(N) space complexity.
Why We Drop Constants in Big O Notation
Do we drop constants for Space Complexity too?
The answer
More FAQs in Why We Drop Constants in Big O Notation
Because Big O describes the overarching growth trend as data scales to infinity. A multiplier of 2 does not change the fact that the growth is linear.
In real-world milliseconds, O(N) is twice as fast. But in Big O academic notation, they belong to the exact same 'Linear' classification bucket.
It is a slower-growing term in a mathematical equation. For example, in O(N^2 + N), the N is non-dominant because as numbers get huge, N^2 completely overshadows it.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.