Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaksood619 committed Nov 29, 2024
1 parent 6770fd3 commit 12ff67e
Show file tree
Hide file tree
Showing 16 changed files with 401 additions and 348 deletions.
301 changes: 89 additions & 212 deletions docs/algorithms/general/algo-ds.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,259 +3,141 @@
## Algorithms

1. Union-Find Algorithm

- Dynamic Connectivity

- Quick Find

- Quick Union

- Improvements

- Weighted Quick Union

- Weighted Quick Union with Path Compression

- Dynamic Connectivity
- Quick Find
- Quick Union
- Improvements
- Weighted Quick Union
- Weighted Quick Union with Path Compression
2. Analysis of algorithms

- Scientific Method of Analysis

- Empirical Method of Analysis

- Scientific Method of Analysis
- Empirical Method of Analysis
3. Stacks and Queues

- Stacks

- Resizing Arrays

- Queues

- Deque

- Randomized Queues

- Stacks
- Resizing Arrays
- Queues
- Deque
- Randomized Queues
4. Elementary Sort

- Selection Sort

- Insertion Sort

- Shell Sort

- Shuffling

- Shuffle Sort

- Knuth Shuffle

- Convex Hull

- Selection Sort
- Insertion Sort
- Shell Sort
- Shuffling
- Shuffle Sort
- Knuth Shuffle
- Convex Hull
5. Merge Sort

- Bottom up mergesort

- Bottom up mergesort
6. Quick Sort

- Quick Select (Selection)

- 3- way partition quicksort (Duplicate Keys)

- System sorts

- Quick Select (Selection)
- 3- way partition quicksort (Duplicate Keys)
- System sorts
7. Priority Queues

- Binary heaps

- Heap sort

- Binary heaps
- Heap sort
8. Elementary Symbol Tables

- Elementary Implementations

Sorted array (Binary Search)

Unordered List (Sequential Search)

2. Ordered Operations

3. Binary Search Trees

4. Ordered Operations in BSTs

5. Deletion in BSTs

9. Balanced Search Trees

- 2-3 Search Trees

- Red-Black Trees

- B-Trees

10. Geometric applications of BST

- 1d Range Search

- Line Segment Intersection

- Kd-Trees

- Interval Search Trees

- Rectangle Intersection

11. Hash Tables

- Uniform Hashing Assumption

- Separate Chaining

- Linear Probing

12. Symbol Table Applications

- Sets

- Dictionary Clients

- Indexing Clients

- Sparse Vectors
- Elementary Implementations
- Sorted array (Binary Search)
- Unordered List (Sequential Search)
9. Ordered Operations
10. Binary Search Trees
11. Ordered Operations in BSTs
12. Deletion in BSTs
13. Balanced Search Trees
- 2-3 Search Trees
- Red-Black Trees
- B-Trees
14. Geometric applications of BST
- 1d Range Search
- Line Segment Intersection
- Kd-Trees
- Interval Search Trees
- Rectangle Intersection
15. Hash Tables
- Uniform Hashing Assumption
- Separate Chaining
- Linear Probing
16. Symbol Table Applications
- Sets
- Dictionary Clients
- Indexing Clients
- Sparse Vectors

## Data Structures

1. Undirected Graphs

- Implementation

- Adjacency Matrix

- Adjacency List

- DFS

- BFS

- Connected Components

- Implementation
- Adjacency Matrix
- Adjacency List
- DFS
- BFS
- Connected Components
2. Directed Graphs

- Topological Sort

- Topological order of an acyclic digraph

- Strongly Connected Components

- Kosaraju-Sharir algorithm for computing strong components of a digraph

- Topological Sort
- Topological order of an acyclic digraph
- Strongly Connected Components
- Kosaraju-Sharir algorithm for computing strong components of a digraph
3. Minimum Spanning Trees

- Kruskal's Algorithm

- Prim's Algorithm

- Kruskal's Algorithm
- Prim's Algorithm
4. Shortest Path

- Dijkstra's Algorithm

- Bellman Ford Algorithm (Negative Weights)

- Dijkstra's Algorithm
- Bellman Ford Algorithm (Negative Weights)
5. Maximum Flow and Minimum Cut

- Ford-Fulkerson Algorithm

- Ford-Fulkerson Algorithm
6. Radix Sorts

- Key-Indexed Counting

- LSD Radix Sort

- MSD Radix Sort

- 3-way Radix Quicksort

- Suffix Arrays

- Key-Indexed Counting
- LSD Radix Sort
- MSD Radix Sort
- 3-way Radix Quicksort
- Suffix Arrays
7. Tries

- R-way Tries

- Ternary Search Tries

- R-way Tries
- Ternary Search Tries
8. Substring Search

- KMP (Knuth-Morris-Pratt)

- Boyer-Moore

- Rabin-Karp

- KMP (Knuth-Morris-Pratt)
- Boyer-Moore
- Rabin-Karp
9. Regular Expressions

- DFA

- NFA

- DFA
- NFA
10. Data Compression

- Run Length Encoding

- Huffman Compression

- LZW Compression

- Burrows-Wheeler

- Run Length Encoding
- Huffman Compression
- LZW Compression
- Burrows-Wheeler
11. Reductions

12. Linear Programming

- Brewer's Problem

- Simplex Algorithm

- Brewer's Problem
- Simplex Algorithm
13. Intractability

- P

- NP

- NP-Complete
- P
- NP
- NP-Complete

## Strategies for algorithms

1. B.U.D. (Bottleneck, Unnecessary work, Duplicated work)

2. Space / Time Tradeoffs

## Resources

1. Coursera - Algorithms Part 1

2. Coursera - Algorithms Part 2

https://www.toptal.com/algorithms/interview-questions

## Most Important Algos / DS / Programming Concepts

1. Depth first search

2. Breadth first search

3. Matching parenthesis

4. Hash Tables

5. Variables / Pointer manipulations

6. Reversing a linked list

7. Sorting fundamentals

8. Recursion

9. Custom data structures (suffix tree)

10. **Binary search**

## BUD Optimization Strategy
Expand All @@ -269,15 +151,10 @@ https://4tee-learn.blogspot.com/2017/12/optimisation-technique-15-bud.html
## Questions to asking when solving a coding interview questions

1. What is the data types of the inputs?

- Can we assume the string is ASCII or Unicode?

- Can we assume the string is ASCII or Unicode?
2. Do we have to worry about load factors?

3. Do we have to validate inputs?

4. Can we assume this fits in memory?

5. Can we use additional data structures?

https://www.freecodecamp.org/news/learn-algorithms-and-data-structures-in-python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ DELETE FROM orders WHERE order_id < 100;

Here, InnoDB locks the gaps between existing rows where `order_id` is less than 100 to prevent new rows from being inserted into these gaps, which would affect the results of this `DELETE` operation.

Therefore it's better to use between for `DELETE` to make operation non-locking

```sql
DELETE FROM orders WHERE order_id betwen 0 and 100;
```

### Index Locks

InnoDB locks the index entries for the rows being deleted. This prevents other transactions from modifying the indexes until the transaction is complete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,12 @@ screen -r
# To attach to specific session
screen -r session_name
# attach to an already attached session (detach from old terminal and attach to new terminal)
screen -r -d 30608
# scroll in a session
ctrl + A > ESC > up and down to scroll
# list the current running screen sessions
screen -ls
Expand Down
Loading

0 comments on commit 12ff67e

Please sign in to comment.