Interview Bootcamp
Ask Author
Back to course home

0% completed

Vote For New Content
Could I get clarification on the space complexity? Returned output list is O(n),...

Salah Osman

Feb 10, 2023

Could I get clarification on the space complexity? Returned output list is O(n), and the subsets take up 2^n resulting in O(n*2^n)

So [1,2...] -> [[],[1],[2],[1,2]....]

0

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

Take a look at the comment right below this comment. Let us know if you still have any questions.

C
cb 2 years ago

"The comment right below this comment" seems to have disappeared.

Why isn't the space complexity simply O(2^n), since we have to store 2^n subsets?