This Repository contains Time and space complexity. Time and space complexity are terms used in computer science to analyze the efficiency of algorithms:
- Definition: It measures the amount of time an algorithm takes to complete as a function of the input size.
- Notation: Typically expressed using big-O notation (e.g., O(n), O(log n)).
- Example: An algorithm with O(n) time complexity means its running time grows linearly with the input size. If the input size doubles, the running time will roughly double as well.
- Definition: It quantifies the amount of memory space an algorithm uses in relation to the input size.
- Notation: Similar to time complexity, expressed using big-O notation.
- Example: An algorithm with O(n) space complexity implies that the amount of memory it uses grows linearly with the input size. If the input size increases, the algorithm's memory consumption will increase proportionally.