Explain caching and memoization
Caching and memoization are techniques used to optimize performance by storing and reusing previously computed results to avoid redundant calculations. They both aim to reduce the time complexity of operations by leveraging previously computed information, but they are used in slightly different contexts and have distinct implementations.