Question: what is the difference between time complexity and space complexity?
Answer: Time complexity is a function describing the amount of time an algorithm takes in terms of the amount of input to the algorithm. ... Space complexity is a function describing the amount of memory (space) an algorithm takes in terms of the amount of input to the algorithm.