A comprehensive collection of Data Structures and Algorithms implementations in both Rust and TypeScript/JavaScript. Perfect for learning, practicing, and mastering DSA concepts with side-by-side language comparisons.
- π GETTING STARTED - Setup verification & first steps
- πΊοΈ ROADMAP - Learning path with checkboxes
- π QUICK START - Commands & troubleshooting
- π VISUAL GUIDES - Diagrams & roadmap images
topics/
βββ arrays/
β βββ kadanes-algorithm/
β β βββ README.md # Problem explanation
β β βββ solution.ts # TypeScript implementation
β β βββ rust/
β β βββ Cargo.toml
β β βββ src/main.rs # Rust implementation
β βββ two-sum/
β βββ ...
βββ linked-lists/
βββ trees/
βββ graphs/
βββ recursion/
βββ dynamic-programming/
βββ ...
- Two Sum -
topics/arrays/two-sum/ - Kadane's Algorithm (Maximum Subarray) -
topics/arrays/kadanes-algorithm/ - Sliding Window Maximum
- Product of Array Except Self
- Container With Most Water
- Reverse Linked List
- Detect Cycle
- Merge Two Sorted Lists
- Remove Nth Node From End
- Valid Parentheses
- Min Stack
- Implement Queue using Stacks
- Binary Tree Traversal (Inorder, Preorder, Postorder)
- Maximum Depth of Binary Tree
- Lowest Common Ancestor
- Validate BST
- DFS & BFS
- Number of Islands
- Course Schedule
- Dijkstra's Algorithm
- Fibonacci Numbers
- Climbing Stairs
- Longest Common Subsequence
- Knapsack Problem
- Binary Search
- Quick Sort
- Merge Sort
- Heap Sort
For TypeScript/JavaScript:
npm installFor Rust:
- Install Rust: https://rustup.rs/
# Run any TypeScript solution
npm run dev topics/arrays/kadanes-algorithm/solution.ts
# Or use ts-node directly
npx ts-node topics/arrays/two-sum/solution.ts# Run any Rust solution by package name
cargo run -p kadanes-algorithm
cargo run -p two-sum
# Run with tests
cargo test -p kadanes-algorithm
# Run all tests
cargo test --workspaceEach problem includes:
- π README.md - Problem statement, examples, complexity analysis
- π» solution.ts - TypeScript implementation with examples
- π¦ rust/src/main.rs - Rust implementation with examples
- β Tests - Unit tests in both languages
- Read the problem in the topic's README
- Try to solve it yourself first
- Compare your solution with the provided implementations
- Run the code to see it in action
- Modify and experiment to deepen understanding
- Pick a topic from the learning path
- Implement in your preferred language first
- Then implement in the other language
- Compare both approaches and learn language-specific patterns
- Focus on common patterns (sliding window, two pointers, etc.)
- Practice explaining complexity analysis
- Implement both brute force and optimized solutions
- Run tests to verify correctness
- Don't rush - Understand the 'why' behind each algorithm
- Compare languages - See how Rust and TypeScript approach the same problem
- Run the code - Don't just read, execute and experiment
- Write tests - Validate your understanding
- Explain out loud - If you can teach it, you know it
TypeScript/JavaScript:
- High-level, expressive syntax
- Great for interviews and web development
- Quick prototyping and iteration
Rust:
- Systems programming mindset
- Memory safety and performance
- Teaches low-level concepts
- Growing in popularity for backend and systems
Learning both gives you:
- Broader perspective on problem-solving
- Better understanding of time/space tradeoffs
- Appreciation for different programming paradigms
The resources/ folder contains additional algorithm and data structure implementations for reference.
MIT