Fixed Typo for DSA Roadmap (#5962)
Added content links and fixed link syntax error. --------- Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>pull/5969/head
parent
2874eb0a42
commit
c9d6b36b34
4 changed files with 15 additions and 3 deletions
@ -1,3 +1,7 @@ |
|||||||
# Time vs Space Complexity |
# Time vs Space Complexity |
||||||
|
|
||||||
In the context of algorithmic complexity, "time" refers to the amount of computational time that the algorithm takes to execute, while "space" refers to the amount of memory that the algorithm needs to complete its operation. The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run, as a function of the size of the input to the program. The space complexity of an algorithm quantifies the amount of space or memory taken by an algorithm to run, as a function of the size of the input to the program. It's important to note that time and space are often at odds with each other; optimizing an algorithm to be quicker often requires taking up more memory, and decreasing memory usage can often make the algorithm slower. This is known as the space-time tradeoff. |
In the context of algorithmic complexity, "time" refers to the amount of computational time that the algorithm takes to execute, while "space" refers to the amount of memory that the algorithm needs to complete its operation. The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run, as a function of the size of the input to the program. The space complexity of an algorithm quantifies the amount of space or memory taken by an algorithm to run, as a function of the size of the input to the program. It's important to note that time and space are often at odds with each other; optimizing an algorithm to be quicker often requires taking up more memory, and decreasing memory usage can often make the algorithm slower. This is known as the space-time tradeoff. |
||||||
|
|
||||||
|
Learn more from the following resources: |
||||||
|
|
||||||
|
- [@article@Cheat Sheet](https://www.bigocheatsheet.com/) |
||||||
|
@ -1,3 +1,8 @@ |
|||||||
# Big O Notation |
# Big O Notation |
||||||
|
|
||||||
"Big O" notation, officially known as O-notation, is used in computer science to describe the performance or complexity of an algorithm. Specifically, it provides an upper bound on the time complexity, describing the worst-case scenario. Thus, it gives an upper limit on the time taken for an algorithm to complete based on the size of the input. The notation is expressed as O(f(n)), where f(n) is a function that measures the largest count of steps that an algorithm could possibly take to solve a problem of size n. For instance, O(n) denotes a linear relationship between the time taken and the input size, while O(1) signifies constant time complexity, i.e., the time taken is independent of input size. Remember, Big O notation is only an approximation meant to describe the scaling of the algorithm and not the exact time taken. |
"Big O" notation, officially known as O-notation, is used in computer science to describe the performance or complexity of an algorithm. Specifically, it provides an upper bound on the time complexity, describing the worst-case scenario. Thus, it gives an upper limit on the time taken for an algorithm to complete based on the size of the input. The notation is expressed as O(f(n)), where f(n) is a function that measures the largest count of steps that an algorithm could possibly take to solve a problem of size n. For instance, O(n) denotes a linear relationship between the time taken and the input size, while O(1) signifies constant time complexity, i.e., the time taken is independent of input size. Remember, Big O notation is only an approximation meant to describe the scaling of the algorithm and not the exact time taken. |
||||||
|
|
||||||
|
Learn more from the following links: |
||||||
|
|
||||||
|
- [@video@Introduction to Big O Notation and Time Complexity](https://www.youtube.com/watch?v=D6xkbGLQesk) |
||||||
|
- [@video@Big-O Notation](https://www.youtube.com/watch?v=BgLTDT03QtU) |
||||||
|
Loading…
Reference in new issue