Skip to content

Commit 7da12cf

Browse files
authored
Update 1547-Minimum-cost-to-cut-a-stick.md
1 parent 4343611 commit 7da12cf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

dsa-solutions/lc-solutions/1500-1599/1547-Minimum-cost-to-cut-a-stick.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ Output:
6666
### Time Complexity and Space Complexity Analysis
6767

6868
- **Initialization**:
69-
- Sorting the cuts array takes O(m log m) time, where m is the number of cuts.
70-
- Initializing the `dp` array takes O(m^2) time.
71-
- Overall initialization time complexity is O(m log m + m^2).
69+
- Sorting the cuts array takes $O(m log m)$ time, where m is the number of cuts.
70+
- Initializing the `dp` array takes $O(m^3)$ time.
71+
- Overall initialization time complexity is $O(m log m + m^2)$.
7272

7373
- **DP Table Calculation**:
7474
- Filling the `dp` table involves iterating over all possible subintervals and calculating the minimum cost for each subinterval using nested loops.
75-
- This takes O(m^3) time in the worst case.
75+
- This takes $O(m^3)$ time in the worst case.
7676

7777
- **Overall Time Complexity**:
78-
- The overall time complexity is O(m^3).
78+
- The overall time complexity is $O(m^3)$.
7979

8080
- **Space Complexity**:
81-
- The `dp` table requires O(m^2) space.
82-
- The space complexity is O(m^2).
81+
- The `dp` table requires $O(m^2)$ space.
82+
- The space complexity is $O(m^2)$.
8383

8484
### Code
8585

0 commit comments

Comments
 (0)