From d190884f7490226f42982709cc1621cade88766c Mon Sep 17 00:00:00 2001 From: sumn2u Date: Sun, 13 Oct 2024 10:12:21 -0500 Subject: [PATCH] added complexity chapter and its content --- en/SUMMARY.md | 3 +++ en/complexity/README.md | 6 +++--- en/complexity/time-complexity.md | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/en/SUMMARY.md b/en/SUMMARY.md index a3c47a93..87df426a 100644 --- a/en/SUMMARY.md +++ b/en/SUMMARY.md @@ -141,6 +141,9 @@ - [Velocity JS](animation-resources/velocityjs.md) - [React Spring](animation-resources/react-spring.md) - [Framer Motion](animation-resources/framer-motion.md) +- [Complexity](complexity/README.md) + - [Space Complexity](complexity/space-complexity.md) + - [Time Complexity](complexity/time-complexity.md) - [JavaScript Behind the Scenes](behind-scenes/README.md) - [Call Stack](behind-scenes/call-stack.md) - [Engine](behind-scenes/engine.md) diff --git a/en/complexity/README.md b/en/complexity/README.md index e46b9b8e..468a4786 100644 --- a/en/complexity/README.md +++ b/en/complexity/README.md @@ -1,11 +1,11 @@ --- layout: editorial -chapter: 8 -pageNumber: 53 +chapter: 27 +pageNumber: 258 description: Analyzing an algorithm's efiiciency is most important part of writing an optimal program. This chapter deep dives into analayzing the efficiency by understanding the space and time complexity. --- -# Chapter 8 +# Chapter 27 # Complexity From previous chapter you should have understood how to create an algorithm. In this chapter, we will explore the intricacies of algorithmic complexity in JavaScript. diff --git a/en/complexity/time-complexity.md b/en/complexity/time-complexity.md index 13c4c07a..0d8cbe29 100644 --- a/en/complexity/time-complexity.md +++ b/en/complexity/time-complexity.md @@ -51,6 +51,6 @@ The code takes n steps to run. Instead of using just plain n for time complexity Some common types of Big O notations are as follows: - O(log n) - logarithmic time complexity -- O($n^2$) - quadratic time complexity +- O(n^2) - quadratic time complexity - O(n) - linear time complexity - O(1) - constant time complexity