Question
You have a program with two (or three) variables, but no other data structures. What is the space complexity?
Answer
O(1). An algorithm, as long as the number of variables is fixed, can have 1,000 variables and be said to have O(1) space complexity. The source is here: