Skip to content

Commit 09b483a

Browse files
Kinshu-Learnersumn2u
authored andcommitted
fixes[#310] Update space complexity chapter formatting (remove $)
fixes[#310]
1 parent 4cbd2cb commit 09b483a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

en/complexity/space-complexity.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Space complexity is the amount of memory that a program takes to run with respec
1111
In this chapter, we will learn about the following space complexities:
1212

1313
- O(n) - linear space complexity
14-
- O($n^2$) - quadratic space complexity
14+
- O(n^2) - quadratic space complexity
1515
- O(1) - constant space complexity
1616

1717
### **Linear Space Complexity: O(n)**
@@ -33,7 +33,7 @@ console.log(squareElements(myArray)); // Output: [1, 4, 9, 16, 25]
3333
In this example, the space complexity is O(n) because the result array grows in proportion to the size of the input array `arr`.
3434

3535

36-
### Quadratic Space Complexity (O($n^2$))
36+
### Quadratic Space Complexity (O(n^2))
3737
The memory required grows proportionally to the square of the input size.
3838

3939
**Example:**
@@ -70,3 +70,4 @@ printCube(3); // Output: 27
7070
```
7171

7272
The space required does not depend on the input size.
73+

0 commit comments

Comments
 (0)