From 4e96a58e549d55653c326c1f98a5d50a2c587cd6 Mon Sep 17 00:00:00 2001 From: Vaibhav Chauhan <95951482+rover07@users.noreply.github.com> Date: Wed, 27 Mar 2024 04:13:13 +0530 Subject: [PATCH] Add complexity video resource (#5399) * feat/ Added complexity video resource Added video resource for time and space complexity in Data structures and Algorithms section. * Replace link --------- Co-authored-by: Kamran Ahmed --- .../content/104-algorithmic-complexity/101-calculating.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/datastructures-and-algorithms/content/104-algorithmic-complexity/101-calculating.md b/src/data/roadmaps/datastructures-and-algorithms/content/104-algorithmic-complexity/101-calculating.md index abe33041f..48b05c6b6 100644 --- a/src/data/roadmaps/datastructures-and-algorithms/content/104-algorithmic-complexity/101-calculating.md +++ b/src/data/roadmaps/datastructures-and-algorithms/content/104-algorithmic-complexity/101-calculating.md @@ -1,3 +1,5 @@ # How to Calculate Complexity? -The process of calculating algorithmic complexity, often referred to as Big O notation, involves counting the operations or steps an algorithm takes in function of the size of its input. The aim is to identify the worst-case, average-case, and best-case complexity. Generally, the main focus is on the worst-case scenario which represents the maximum number of steps taken by an algorithm. To calculate it, you consider the highest order of size (n) in your algorithm's steps. For instance, if an algorithm performs a loop 5 times for 'n' items, and then does 3 unrelated steps, it has a complexity of O(n), because the linear steps grow faster than constant ones as n increases. Other complexities include O(1) for constant complexity, O(n) for linear complexity, O(n^2) for quadratic complexity, and so on, based on how the steps increase with size. \ No newline at end of file +The process of calculating algorithmic complexity, often referred to as Big O notation, involves counting the operations or steps an algorithm takes in function of the size of its input. The aim is to identify the worst-case, average-case, and best-case complexity. Generally, the main focus is on the worst-case scenario which represents the maximum number of steps taken by an algorithm. To calculate it, you consider the highest order of size (n) in your algorithm's steps. For instance, if an algorithm performs a loop 5 times for 'n' items, and then does 3 unrelated steps, it has a complexity of O(n), because the linear steps grow faster than constant ones as n increases. Other complexities include O(1) for constant complexity, O(n) for linear complexity, O(n^2) for quadratic complexity, and so on, based on how the steps increase with size. + +- [Time & Space Complexity](https://www.youtube.com/watch?v=Z0bH0cMY0E8)