Complete JavaScript implementations of fundamental and advanced data structures and algorithms — stacks, queues, linked lists, trees, sorting, graphs, hash tables, and recursion. Built from scratch, no libraries.
Following the roadmap.sh DSA guide as a structured curriculum. Every implementation is written in pure ES6+ JavaScript and runnable directly with Node.js.
| Folder | Structure | Variants |
|---|---|---|
Stack |
Stack | Array-based, Linked list–based |
Queue |
Queue | Array-based, Linked list–based, Priority Queue |
LinkList |
Linked List | Singly, Doubly, Circular |
Hash-Tables |
Hash Table | With collision resolution |
Tree |
Trees | BST, B-Tree, B+ Tree, AVL Tree |
Graph |
Graph | Adjacency list representation |
| Folder | Topic | What's Covered |
|---|---|---|
Sorting |
Sorting | Bubble, Selection, Insertion, Merge, Quick, Heap Sort |
Graph |
Graph Traversal | BFS (Breadth-First Search), DFS (Depth-First Search) |
Recursion |
Recursion | Factorial, Fibonacci, sum of natural numbers, recursive patterns |
Array |
Array Algorithms | Array manipulation and common interview problems |
patterns |
Pattern Printing | Numeric, star, and mixed console patterns |
| Folder | Topic |
|---|---|
Master_basics |
DSA fundamentals and problem-solving patterns |
Mater_basics |
JavaScript basics — arithmetic, control flow, functions |
No installation needed beyond Node.js.
# 1. Clone the repo
git clone https://github.com/Wcoder547/DSA_WITH_JS.git
cd DSA_WITH_JS
# 2. Navigate to any folder
cd Sorting
# 3. Run any file
node quickSort.jsEvery file is standalone — just node <filename>.js.
DSA_WITH_JS/
├── Array/ # Array manipulation & problems
├── Graph/ # BFS, DFS traversal
├── Hash-Tables/ # Hash table with collision resolution
├── LinkList/ # Singly, Doubly, Circular linked lists
├── Master_basics/ # DSA fundamentals
├── Mater_basics/ # JS basics
├── Queue/ # Array, linked list, priority queue
├── Recursion/ # Recursive algorithms
├── Sorting/ # 6 sorting algorithms
├── Stack/ # Array-based & linked list–based stack
├── Tree/ # BST, B-Tree, B+ Tree, AVL Tree
└── patterns/ # Pattern printing
- Trie — prefix tree for string operations
- Segment Tree — range query and update
- Fenwick Tree (Binary Indexed Tree) — efficient prefix sums
- Suffix Array & Suffix Tree — advanced string algorithms
DSA is the foundation of everything in software engineering — understanding how data is stored, accessed, and transformed is what separates writing code that works from writing code that scales.
This repo was built by working through the roadmap.sh DSA curriculum in JavaScript, implementing every structure and algorithm from scratch without libraries. The goal was depth over speed: understanding why a B+ Tree splits the way it does, why quicksort degrades on sorted input, why a hash table needs collision resolution.
Built by Waseem Akram — Full-Stack Developer and DevOps Engineer based in Pakistan, working across the MERN stack, Generative AI integrations, and cloud automation.
If this helped you, consider giving it a ⭐