Skip to content

A collection of fundamental data structures implemented in JavaScript. This project includes clean, beginner-friendly examples of commonly used data structures such as arrays, linked lists, stacks, queues, trees, graphs, and more.

Notifications You must be signed in to change notification settings

manish0502/Data-Structures-Using-Js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Data Structures & Algorithms in JavaScript 🚀

JavaScript DSA Status

My journey through fundamental computer science concepts using JavaScript


🌟 Introduction

Welcome to my Data Structures and Algorithms learning repository!
This project documents my journey through understanding essential computer science concepts and implementing them using JavaScript.
From basic array manipulations to complex algorithm patterns, everything is captured here with clear examples and explanations.

Whether you're a fellow learner or just browsing, I hope these implementations and notes prove helpful in your own DSA journey.


📋 Topics Covered

Data Structure/Algorithm Status Topics Covered
📦 Arrays & Strings 📝 Basic operations, Sliding Window, Two Pointers, Searching, Sorting
🔗 Linked Lists 📝 Single, Double, Circular, Reverse, Merge, Detect Cycles
📚 Stacks Implementation, Balanced Parentheses, Expression Evaluation, Min Stack
🧺 Queues 🔄 Implementation, Circular Queue, Priority Queue, BFS Applications
🌳 Trees 📝 Binary Trees, BST, AVL, Tree Traversals (In/Pre/Post/Level-order)
📊 Heaps 📝 Min/Max Heap, Heap Sort, Priority Queue Implementation
📈 Hash Tables 📝 Implementation, Collision Resolution, Applications
🕸️ Graphs 📝 Representations, BFS, DFS, Dijkstra's, Topological Sort
🧩 Recursion 📝 Base Cases, Call Stack, Classic Problems (Fibonacci, Factorial)
📝 Dynamic Programming 📝 Memoization, Tabulation, Common DP Problems
🔍 Searching Algorithms 📝 Binary Search, Linear Search, Jump Search
⚡ Sorting Algorithms 📝 Bubble, Selection, Insertion, Merge, Quick, Heap Sort
⚔️ Greedy Algorithms 📝 Activity Selection, Huffman Coding, Dijkstra's
🧠 Problem-Solving Patterns 📝 Sliding Window, Two Pointers, Fast & Slow Pointers

Legend: ✅ - Completed, 🔄 - In Progress, 📝 - Planned


🔬 Core Concepts

Big O Notation

Understanding algorithmic efficiency is crucial. Here's a quick reference:

Notation Name Example
O(1) Constant Array access, Hash table insertion
O(log n) Logarithmic Binary search, Balanced BST operations
O(n) Linear Linear search, Traversing arrays
O(n log n) Linearithmic Merge sort, Heap sort
O(n²) Quadratic Bubble sort, Insertion sort
O(2ⁿ) Exponential Recursive Fibonacci, Tower of Hanoi

Problem-Solving Approaches

  • Divide & Conquer: Break problems into smaller subproblems
  • Dynamic Programming: Solve each subproblem once and store results
  • Greedy Algorithms: Make locally optimal choices at each step
  • Backtracking: Build solutions incrementally and abandon paths that fail

📁 Repository Structure

Data-Structures-Using-JavaScript/
├── arrays/
│   ├── README.md          # Explanation of array concepts
│   ├── examples/          # Basic array operations
│   └── problems/          # Array-based problem solutions
├── linked-lists/
│   ├── README.md          # Linked list concepts
│   ├── singly/            # Singly linked list implementation
│   └── doubly/            # Doubly linked list implementation
├── stacks/
│   ├── implementation.js  # Stack implementation
│   └── problems/          # Stack-based problem solutions
├── queues/
│   ├── implementation.js  # Queue implementation
│   └── problems/          # Queue-based problem solutions
├── trees/
│   ├── binary-tree.js     # Binary tree implementation
│   ├── bst.js             # Binary search tree implementation
│   └── traversals/        # Tree traversal algorithms
├── graphs/
│   ├── representations/   # Adjacency matrix/list implementations
│   └── algorithms/        # Graph algorithms (BFS, DFS, etc.)
├── algorithms/
│   ├── searching/         # Searching algorithms
│   ├── sorting/           # Sorting algorithms
│   └── recursion/         # Recursion examples
├── design-patterns/       # Common design patterns in JS
├── utils/                 # Helper functions and utilities
├── visualizations/        # Visual representations of concepts
└── README.md              # This file

🚀 Getting Started

Prerequisites

  • Node.js (v14+)
  • Basic understanding of JavaScript

Running Examples

Most examples can be run directly with Node:

# Run an array example
node arrays/examples/two-sum.js

# Run a sorting algorithm
node algorithms/sorting/merge-sort.js

📚 Learning Resources

Books, courses, and websites that have been helpful in my journey:

📖 Books

  • Cracking the Coding Interview by Gayle Laakmann McDowell
  • JavaScript Data Structures and Algorithms by Sammie Bae
  • Grokking Algorithms by Aditya Bhargava

🌐 Online Resources



🤝 Contributions

While this is primarily a personal learning repository, suggestions and feedback are always welcome! Feel free to:

  • Open an issue for corrections
  • Suggest improvements or alternative solutions
  • Share resources that might be helpful

📝 Notes

  • All implementations focus on readability over optimization
  • Code snippets include time and space complexity analysis
  • Test cases are provided for most implementations

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


Happy Coding! 💻
Remember: Every expert was once a beginner. Keep learning!

About

A collection of fundamental data structures implemented in JavaScript. This project includes clean, beginner-friendly examples of commonly used data structures such as arrays, linked lists, stacks, queues, trees, graphs, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published