Skip to content

Commit

Permalink
Update SMAWK Algorithm.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AE-Hertz authored Nov 9, 2024
1 parent 1995d56 commit 8eb1e20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/algorithms/SMAWK Algorithm/SMAWK Algorithm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

id: SMAWK-Algorithm
id: smawk-algorithm
sidebar_position: 19
title: "SMAWK Algorithm"
sidebar_label: SMAWK Algorithm
Expand All @@ -20,12 +20,13 @@ The **SMAWK Algorithm** is a specialized algorithm for efficiently finding row m

### Time Complexity

- **Average Case**: \( O(n \log n) \), where \( n \) is the number of rows in the matrix.
- **Worst Case**: \( O(n m) \), where \( m \) is the number of columns in the matrix.
- **Average Case**: $O(n \log n)$, where $n$ is the number of rows in the matrix.
- **Worst Case**: $O(n \cdot m)$, where $m$ is the number of columns in the matrix.


### Space Complexity

- **Space Complexity**: \( O(n) \), since only a few vectors (of size \( n \)) are used to store the row minima and the active set.
- **Space Complexity**: $O(n)$, since only a few vectors (of size $n$) are used to store the row minima and the active set.

### Approach

Expand Down

0 comments on commit 8eb1e20

Please sign in to comment.