Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
425 changes: 425 additions & 0 deletions notes/backtracking.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notes/basic_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Big O notation is a practical tool for comparing growth bounds. The examples bel
Use these growth rates to explain the work an algorithm performs. Nested loops may be quadratic, but their actual iteration bounds matter; repeated halving usually introduces a logarithm. Derive the bound from the work rather than from the visual shape of the code.

- The time complexity $O(1)$, known as constant time complexity, means that regardless of the input size, the algorithm performs its task in a fixed amount of time. A common example of this is retrieving an item by its index from an array or, under suitable hashing and load assumptions, an expected constant-time hash-table lookup.
- When an algorithm has $O(log n)$ time complexity, it operates logarithmically, meaning the time taken increases logarithmically with input size. As the input size doubles, the time taken only increases marginally. Binary search and operations on balanced binary trees are typical examples.
- When an algorithm has $O(\log n)$ time complexity, it operates logarithmically, meaning the time taken increases logarithmically with input size. As the input size doubles, the time taken only increases marginally. Binary search and operations on balanced binary trees are typical examples.
- An algorithm with $O(n)$ time complexity exhibits linear behavior, where the running time scales directly with the input size. This is seen in simple, single-pass processes like iterating over an array or a linked list.
- In cases of $O(n log n)$ time complexity, also called log-linear complexity, the running time grows both linearly and logarithmically with the input size. Merge sort and heap sort have this worst-case bound; randomized quicksort has this expected bound but can take quadratic time in the worst case.
- With $O(n^2)$ time complexity, the running time increases quadratically, often due to nested loops. Algorithms like Bubble Sort and Insertion Sort fall into this category.
Expand Down
361 changes: 360 additions & 1 deletion notes/dynamic_programming.md

Large diffs are not rendered by default.

365 changes: 363 additions & 2 deletions notes/graphs.md

Large diffs are not rendered by default.

348 changes: 348 additions & 0 deletions notes/math_set_relationship.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notes/matrices.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ Rotate each ring by cycling 4 positions.

How it works:

For layer $\ell$ with bounds $ [\ell..n-1-\ell]$, for each offset move:
For layer $\ell$ with bounds $[\ell..n-1-\ell]$, for each offset move:

```
top ← left, left ← bottom, bottom ← right, right ← top
Expand Down
394 changes: 380 additions & 14 deletions notes/searching.md

Large diffs are not rendered by default.

311 changes: 311 additions & 0 deletions notes/sorting.md

Large diffs are not rendered by default.

Loading