Woh extra memory jo algorithm input se alag allocate karta hai (temp vars, helper arrays, recursion stack).
What is total space?
Input space + auxiliary space.
Why do we usually report auxiliary space when comparing algorithms?
Kyunki algorithm sirf scratch memory control karta hai; input size caller ne fix ki hoti hai.
What hidden cost does recursion add to space?
Call stack — depth × frame size; max simultaneous frames auxiliary space mein count hote hain.
Auxiliary space of in-place array reversal?
O(1).
Auxiliary space of naive recursive Fibonacci?
O(n) (max stack depth), O(2^n) NAHI jo uska time hai.
Merge sort vs quick sort auxiliary space?
Merge O(n) (temp array); Quick O(log n) average (recursion stack).
Total space formula?
Total = S_input + S_aux.
Why is storing all subsets O(2^n · n) space?
2^n subsets hote hain, har ek n elements tak lamba hota hai.
A function with 5 scalar locals and no arrays — auxiliary space?
O(1), constant count jo n se independent hai.
Recall Feynman: ek 12-saal ke bachche ko samjhao
Socho tumhe LEGOs ka ek bada dabba diya gaya hai (yeh input hai). Kuch banana ke liye, tum kabhi kabhi ek khali tray nikalte ho pieces sort karne ke liye — woh tray tumhari auxiliary space hai, woh extra cheez jo tum khud laaye ho. Total space dabba aur tray dono milake hoti hai. Ek smart builder ek chhoti tray use karta hai (kam auxiliary). Aur dhyan do! Agar tum ek ke andar ek nayi chhoti side-projects shuru karte jaate ho (recursion), toh har ek ko apni chhoti tray chahiye, aur woh sab ek saath table par rakhti hain — yeh trayon ka ek sneaky dher hai jise tum count karna bhool gaye.