Welcome to the JS Data Structures & Algorithms repository!
This project takes you from JavaScript basics all the way to advanced DSA problems, making it a perfect companion for interviews, competitive programming, and system design preparation.
📌 Repository:
js-data-structures-algorithms
👨💻 Author: ExploitEngineer
- Sum of two numbers
- Type coercion & string concatenation
- Swap variables (3 methods)
- Operators: Arithmetic, Relational, Logical, Unary
- Math Functions:
round()
,ceil()
,floor()
,trunc()
,pow()
,sqrt()
,abs()
,random()
,toFixed()
- Problems:
- Rectangle area & perimeter
- OTP generator
- Triangle area (Heron’s formula)
- Circle circumference
- If-Else, Ternary, Switch
- Problems:
- Valid user checker
- Shop discount logic
- Utility bill (Biji bill)
- INR denomination
- For, While, Do-While
- Problems:
- Print "Hello" N times
- 1 to N and N to 1
- Sum & factorial
- Prime number
- Sum of digits
- Strong number
- Reverse number
- Guess the number
- Calculator app
- Nested loops
- Classic pattern problems
- Fixed vs Dynamic arrays
- Accept user input
- Problems:
- Sum of elements
- Max & second max
- Reverse array
- Shift zeros left, ones right
- String methods
- Problems:
- Character-by-character printing
- Reverse string
- Palindrome checker
- Toggle case
- Character frequency
- Class & Object
- Constructor,
this
, Prototype - Design-based problems
- Left/Right rotation by K
- Remove duplicates (sorted array)
- Merge sorted arrays
- Best time to buy & sell stock
- Sort colors
- Kadane’s Algorithm
- Moore’s Voting
- Trapping Rain Water
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Missing number
- Disappeared numbers
- First missing positive
- Classic Binary Search
- Search Insert Position
- Rotated Sorted Array
- Book Allocation
- Koko Eating Bananas
- Threshold limit problems
- Frequency map
- Unique elements
- Pangram checker
- Sort by people
- Two Sum
- Subarray sum equals K
- Longest subarray with sum K
- Longest consecutive sequence
- Implementation
- Design LL
- Find middle
- Detect cycle
- Reverse list
- Delete node
- Reverse in K groups
- Stack & Queue implementation
- Valid parentheses
- Stack using queue
- Queue using stack
- Next greater element
- Largest rectangle in histogram
- Print Hello N times
- N to 1, 1 to N
- Sum & factorial
- Digit sum
- Fibonacci (2 ways)
- Tower of Hanoi
- Josephus problem
- Subsets & permutations
- Combination sum
- Sudoku solver
- Implementation
- DFS (Pre, In, Post)
- Max depth
- Symmetric tree
- BFS
- Left & Top view
- Lowest Common Ancestor
- Build tree (Preorder + Inorder)
- Validate BST
- Kth smallest in BST
- Delete node from BST
- Graph implementation
- BFS & DFS
- Cycle detection
- Topological sort
- Shortest Path Algorithms
- Language: JavaScript (ES6+)
- Tools: Git, GitHub, Notion (for notes)
- Practice Style: Problem-first, then explanation
# Clone this repo
git clone https://github.com/ExploitEngineer/js-data-structures-algorithms.git
# Move into project folder
cd js-data-structures-algorithms
🙌 Contribute If you find bugs or want to improve the code/docs:
- Star ⭐ this repo
- Fork 🍴 the project
- Open a PR or Issue
📄 License MIT License — feel free to use, modify, or share!
Happy coding, keep learning, and never stop solving! 🚀✨