mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 21:22:43 +00:00
docs(docs): restructure documentation directories and remove placeholder study decks
This commit is contained in:
1 parent
3224db8bd4
commit
64cfcb53e6
30 files changed
-30
No files matched your search
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: 'Two Pointers'
|
||||
description: 'Converging/parallel index walk that prunes the O(n^2) pair space using order.'
|
||||
---
|
||||
|
||||
:::warning[Under construction]
|
||||
This page is a scaffold. Notes, canonical problems, and template code are not written yet.
|
||||
:::
|
||||
|
||||
## Concepts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: 'Prefix Sum'
|
||||
description: 'Precomputed cumulative state for O(1) range queries.'
|
||||
---
|
||||
|
||||
:::warning[Under construction]
|
||||
This page is a scaffold. Notes, canonical problems, and template code are not written yet.
|
||||
:::
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: 'Sliding Window'
|
||||
description: 'Two pointers plus incremental state between them.'
|
||||
---
|
||||
|
||||
:::warning[Under construction]
|
||||
This page is a scaffold. Notes, canonical problems, and template code are not written yet.
|
||||
:::
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: 'Binary Search'
|
||||
description: 'In algorithms, arrays and strings are very similar. They are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.'
|
||||
---
|
||||
|
||||
|
||||
Technically, an array can't be resized. A dynamic array, or list, can be. In the context of algorithm problems, usually when people talk about arrays, they are referring to dynamic arrays. In this entire course, we will be talking about dynamic arrays/lists, but we will just use the word "array".
|
||||
|
||||
## Time Complexity
|
||||
|
||||
Arrays and strings are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.
|
||||
|
||||
| Operation | Array/List | String(Immutable) |
|
||||
| --------- | ---------- | ----------------- |
|
||||
| Appending to end | *O(1) | O(n) |
|
||||
| Popping from end | O(1) | O(n) |
|
||||
| Insertion, not from end | O(n) | O(n) |
|
||||
| Deletion, not from end | O(n) | O(n) |
|
||||
| Modifying an element | O(1) | O(n) |
|
||||
| Random access | *O(1) | O(n) |
|
||||
| Checking if an element exists | O(1) | O(n) |
|
||||
|
||||
:::note[Clarification 1]
|
||||
Appending to the end of a list is amortized O(1) time complexity. This means that the time complexity of appending to the end of a list is the same as the time complexity of appending to the end of an array.
|
||||
:::
|
||||
|
||||
:::note[Clarification 2]
|
||||
Random access in this context means that you can access an element at any index in constant time.
|
||||
:::
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: 'Arrays and Strings'
|
||||
description: 'In algorithms, arrays and strings are very similar. They are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.'
|
||||
sidebar:
|
||||
label: Arrays & Strings
|
||||
---
|
||||
|
||||
|
||||
Technically, an array can't be resized. A dynamic array, or list, can be. In the context of algorithm problems, usually when people talk about arrays, they are referring to dynamic arrays. In this entire course, we will be talking about dynamic arrays/lists, but we will just use the word "array".
|
||||
|
||||
## Time Complexity
|
||||
|
||||
Arrays and strings are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.
|
||||
|
||||
| Operation | Array/List | String(Immutable) |
|
||||
| --------- | ---------- | ----------------- |
|
||||
| Appending to end | *O(1) | O(n) |
|
||||
| Popping from end | O(1) | O(n) |
|
||||
| Insertion, not from end | O(n) | O(n) |
|
||||
| Deletion, not from end | O(n) | O(n) |
|
||||
| Modifying an element | O(1) | O(n) |
|
||||
| Random access | *O(1) | O(n) |
|
||||
| Checking if an element exists | O(1) | O(n) |
|
||||
|
||||
:::note[Clarification 1]
|
||||
Appending to the end of a list is amortized O(1) time complexity. This means that the time complexity of appending to the end of a list is the same as the time complexity of appending to the end of an array.
|
||||
:::
|
||||
|
||||
:::note[Clarification 2]
|
||||
Random access in this context means that you can access an element at any index in constant time.
|
||||
:::
|
||||
|
||||
## Patterns
|
||||
|
||||
<Columns cols={2}>
|
||||
<Column>
|
||||
<Tile
|
||||
title="Two Pointers"
|
||||
description="Ship your first page in minutes."
|
||||
href="/arrays-and-strings/two-pointers"
|
||||
>
|
||||
<Icon icon="rocket" size={28} />
|
||||
</Tile>
|
||||
</Column>
|
||||
<Column>
|
||||
<Tile
|
||||
title="Sliding Window"
|
||||
description="Ship your first page in minutes."
|
||||
href="/docs/quickstart"
|
||||
>
|
||||
<Icon icon="rocket" size={28} />
|
||||
</Tile>
|
||||
</Column>
|
||||
<Column>
|
||||
<Tile
|
||||
title="Prefix Sum"
|
||||
description="Ship your first page in minutes."
|
||||
href="/docs/quickstart"
|
||||
>
|
||||
<Icon icon="rocket" size={28} />
|
||||
</Tile>
|
||||
</Column>
|
||||
</Columns>
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: 'Hashing'
|
||||
description: 'In algorithms, arrays and strings are very similar. They are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.'
|
||||
---
|
||||
|
||||
|
||||
Technically, an array can't be resized. A dynamic array, or list, can be. In the context of algorithm problems, usually when people talk about arrays, they are referring to dynamic arrays. In this entire course, we will be talking about dynamic arrays/lists, but we will just use the word "array".
|
||||
|
||||
## Time Complexity
|
||||
|
||||
Arrays and strings are both ordered collections of elements. The difference is that arrays are mutable, while strings are immutable.
|
||||
|
||||
| Operation | Array/List | String(Immutable) |
|
||||
| --------- | ---------- | ----------------- |
|
||||
| Appending to end | *O(1) | O(n) |
|
||||
| Popping from end | O(1) | O(n) |
|
||||
| Insertion, not from end | O(n) | O(n) |
|
||||
| Deletion, not from end | O(n) | O(n) |
|
||||
| Modifying an element | O(1) | O(n) |
|
||||
| Random access | *O(1) | O(n) |
|
||||
| Checking if an element exists | O(1) | O(n) |
|
||||
|
||||
:::note[Clarification 1]
|
||||
Appending to the end of a list is amortized O(1) time complexity. This means that the time complexity of appending to the end of a list is the same as the time complexity of appending to the end of an array.
|
||||
:::
|
||||
|
||||
:::note[Clarification 2]
|
||||
Random access in this context means that you can access an element at any index in constant time.
|
||||
:::
|
||||
|
||||
Reference in new issue
Block a user