Skip to content

Commit

Permalink
Merge pull request #28 from jcdan3/master
Browse files Browse the repository at this point in the history
Add time complexity for deque
  • Loading branch information
gibsjose authored Mar 23, 2022
2 parents 23d65f8 + 30cbe62 commit 7a1163b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Data Structures and Algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ v.clear();
* Pronounced 'deck'
* Stands for **D**ouble **E**nded **Que**ue

**Time Complexity**

| Operation | Time Complexity |
|--------------|-----------------|
| Insert Head | `O(1)` |
| Insert Index | `O(n) or O(1)`|
| Insert Tail | `O(1)` |
| Remove Head | `O(1)` |
| Remove Index | `O(n)` |
| Remove Tail | `O(1)` |
| Find Index | `O(1)` |
| Find Object | `O(n)` |

**Example Code**
```c++
std::deque<int> d;
Expand Down

0 comments on commit 7a1163b

Please sign in to comment.