Skip to content

📘 A structured and consistent journey through Data Structures and Algorithms using JavaScript. This repo includes problems, solutions, and explanations to strengthen core programming logic and prepare for real-world engineering & tech interviews.

Notifications You must be signed in to change notification settings

ExploitEngineer/js-data-structures-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 JS Data Structures & Algorithms

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


📁 Topics Covered

1️⃣ Basic JavaScript Logic

  • 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

2️⃣ Conditional Statements & Control Flow

  • If-Else, Ternary, Switch
  • Problems:
    • Valid user checker
    • Shop discount logic
    • Utility bill (Biji bill)
    • INR denomination

3️⃣ Loops

  • 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

4️⃣ Pattern Programming

  • Nested loops
  • Classic pattern problems

5️⃣ Arrays

  • Fixed vs Dynamic arrays
  • Accept user input
  • Problems:
    • Sum of elements
    • Max & second max
    • Reverse array
    • Shift zeros left, ones right

6️⃣ Strings

  • String methods
  • Problems:
    • Character-by-character printing
    • Reverse string
    • Palindrome checker
    • Toggle case
    • Character frequency

7️⃣ Object-Oriented Programming

  • Class & Object
  • Constructor, this, Prototype
  • Design-based problems

🔥 The Real DSA Journey Begins Here

8️⃣ Advanced Array Questions

  • 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

9️⃣ Sorting Algorithms (Part 1)

  • Bubble Sort
  • Selection Sort
  • Insertion Sort

🔟 Sorting Algorithms (Part 2)

  • Merge Sort
  • Quick Sort

1️⃣1️⃣ Cyclic Sort

  • Missing number
  • Disappeared numbers
  • First missing positive

📌 Binary Search

  • Classic Binary Search
  • Search Insert Position
  • Rotated Sorted Array
  • Book Allocation
  • Koko Eating Bananas
  • Threshold limit problems

🧠 Hashing

  • Frequency map
  • Unique elements
  • Pangram checker
  • Sort by people
  • Two Sum
  • Subarray sum equals K
  • Longest subarray with sum K
  • Longest consecutive sequence

🔗 Linked List

  • Implementation
  • Design LL
  • Find middle
  • Detect cycle
  • Reverse list
  • Delete node
  • Reverse in K groups

📚 Stack & Queue

  • Stack & Queue implementation
  • Valid parentheses
  • Stack using queue
  • Queue using stack
  • Next greater element
  • Largest rectangle in histogram

🔁 Recursion & Backtracking

  • 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

🌳 Binary Tree

  • Implementation
  • DFS (Pre, In, Post)
  • Max depth
  • Symmetric tree
  • BFS
  • Left & Top view
  • Lowest Common Ancestor
  • Build tree (Preorder + Inorder)

🌲 Binary Search Tree

  • Validate BST
  • Kth smallest in BST
  • Delete node from BST

🌐 Graph

  • Graph implementation
  • BFS & DFS
  • Cycle detection
  • Topological sort
  • Shortest Path Algorithms

⚙️ Tech Stack

  • Language: JavaScript (ES6+)
  • Tools: Git, GitHub, Notion (for notes)
  • Practice Style: Problem-first, then explanation

🛠️ Setup

# 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! 🚀✨

About

📘 A structured and consistent journey through Data Structures and Algorithms using JavaScript. This repo includes problems, solutions, and explanations to strengthen core programming logic and prepare for real-world engineering & tech interviews.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published