Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

πŸ“˜ 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

32 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

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

Conditional Statements & Control Flow

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

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

Pattern Programming

  • Nested loops
  • Classic pattern problems

Arrays

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

Strings

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

Object-Oriented Programming

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

πŸ”₯ The Real DSA Journey Begins Here

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

Sorting Algorithms (Part 1)

  • Bubble Sort
  • Selection Sort
  • Insertion Sort

Sorting Algorithms (Part 2)

  • Merge Sort
  • Quick Sort

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

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /