Skip to content

Latest commit

ย 

History

History
281 lines (226 loc) ยท 11.5 KB

File metadata and controls

281 lines (226 loc) ยท 11.5 KB

๐Ÿš€ JavaScript DSA Practice

Daily Practice Language Problems Solved

A daily practice repository for mastering Data Structures and Algorithms using modern JavaScript. Built on the philosophy of consistent progress over perfection โ€” solving 1-2 problems daily to build strong foundations and problem-solving confidence.

"It's not about rushing โ€” it's about showing up daily and solving with clarity. One problem at a time. One level up each day."

๐ŸŽฏ Learning Philosophy

Core Principles

  • ๐Ÿ“… Daily Consistency - Regular practice builds lasting skills
  • ๐Ÿ” Fundamentals First - Strong basics before advanced patterns
  • ๐Ÿง  Deep Understanding - Clarity over speed, comprehension over completion
  • โšก Modern JavaScript - ES6+ features for clean, concise solutions
  • ๐Ÿ“Š Complexity Awareness - Understanding time and space trade-offs

๐Ÿ“š Focus Areas & Progress

๐ŸŸข Core Data Structures

Structure Status Key Concepts
Arrays & Strings ๐Ÿ”„ In Progress Manipulation, traversal, substring problems
Linked Lists ๐Ÿ“ Planned Singly/doubly linked, operations, pointers
Stacks & Queues ๐Ÿ“ Planned LIFO/FIFO operations, applications
Hash Maps & Sets ๐Ÿ“ Planned O(1) lookups, frequency counting

๐ŸŸก Advanced Structures

Structure Status Key Concepts
Trees & Graphs ๐Ÿ“ Planned Binary trees, BST, BFS, DFS
Heaps ๐Ÿ“ Planned Priority queues, heap operations

๐Ÿ”ต Algorithm Patterns

Pattern Status Key Concepts
Recursion & Backtracking ๐Ÿ“ Planned Base cases, call stack, decision trees
Sorting & Searching ๐Ÿ“ Planned Binary search, merge sort, quick sort
Two Pointers ๐Ÿ“ Planned Left-right, fast-slow pointer techniques
Sliding Window ๐Ÿ“ Planned Fixed/variable window, optimization
Prefix Sum ๐Ÿ“ Planned Cumulative sums, range queries

๐Ÿ› ๏ธ Tech Stack & Standards

JavaScript Node.js LaTeX

Code Quality Standards

  • Modern JavaScript - ES6+ syntax (arrow functions, destructuring, template literals)
  • Clean Code - Descriptive naming, logical structure, minimal complexity
  • Comprehensive Comments - Algorithm explanation, complexity analysis
  • Test Cases - Multiple scenarios including edge cases
  • Performance Focus - Time and space complexity documentation

๐Ÿ—๏ธ Repository Structure

JavaScript-DSA/
โ”œโ”€โ”€ 01-Arrays-Strings/
โ”‚   โ”œโ”€โ”€ easy/
โ”‚   โ”‚   โ”œโ”€โ”€ two-sum.js
โ”‚   โ”‚   โ”œโ”€โ”€ reverse-string.js
โ”‚   โ”‚   โ””โ”€โ”€ valid-palindrome.js
โ”‚   โ”œโ”€โ”€ medium/
โ”‚   โ”‚   โ”œโ”€โ”€ longest-substring.js
โ”‚   โ”‚   โ””โ”€โ”€ three-sum.js
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ 02-Linked-Lists/
โ”‚   โ”œโ”€โ”€ implementation/
โ”‚   โ”‚   โ”œโ”€โ”€ singly-linked-list.js
โ”‚   โ”‚   โ””โ”€โ”€ doubly-linked-list.js
โ”‚   โ”œโ”€โ”€ problems/
โ”‚   โ”‚   โ”œโ”€โ”€ reverse-linked-list.js
โ”‚   โ”‚   โ””โ”€โ”€ merge-sorted-lists.js
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ 03-Stacks-Queues/
โ”œโ”€โ”€ 04-Trees-Graphs/
โ”œโ”€โ”€ 05-Recursion-Backtracking/
โ”œโ”€โ”€ 06-Sorting-Searching/
โ”œโ”€โ”€ 07-Algorithm-Patterns/
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ test-helpers.js
โ”‚   โ””โ”€โ”€ complexity-analyzer.js
โ””โ”€โ”€ README.md

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • Basic JavaScript knowledge
  • Problem-solving mindset

Quick Setup

  1. Clone the repository

    git clone https://github.com/sh1v-max/JavaScript-DSA.git
    cd JavaScript-DSA
    
  2. Run any solution

    # Example: Run a specific problem
    node 01-Arrays-Strings/easy/two-sum.js
    
    # Run with test cases
    node 01-Arrays-Strings/easy/two-sum.js --test
    
  3. Explore and practice

    • Each folder contains problems organized by difficulty
    • Solutions include detailed comments and complexity analysis
    • Test cases provided for verification

๐Ÿ’ก Solution Template

/**
 * Problem: Two Sum
 * Difficulty: Easy
 * Time Complexity: O(n)
 * Space Complexity: O(n)
 * 
 * Approach: Hash map for O(1) complement lookup
 * 
 * @param {number[]} nums - Array of integers
 * @param {number} target - Target sum
 * @returns {number[]} Indices of two numbers that sum to target
 */
function twoSum(nums, target) {
    const numMap = new Map();
    
    for (let i = 0; i < nums.length; i++) {
        const complement = target - nums[i];
        
        if (numMap.has(complement)) {
            return [numMap.get(complement), i];
        }
        
        numMap.set(nums[i], i);
    }
    
    return []; // No solution found
}

// Test Cases
const testCases = [
    { nums: , target: 9, expected:  },[1][2][3][4]
    { nums: , target: 6, expected:  },[1][2][5][6]
    { nums: , target: 6, expected:  }[5][1]
];

// Run tests
testCases.forEach((test, index) => {
    const result = twoSum(test.nums, test.target);
    console.log(`Test ${index + 1}: ${JSON.stringify(result)} ${
        JSON.stringify(result) === JSON.stringify(test.expected) ? 'โœ…' : 'โŒ'
    }`);
});

๐Ÿ“ˆ Progress Tracking

Current Stats

  • ๐Ÿ“Š Problems Solved: Growing daily
  • ๐ŸŽฏ Current Focus: Arrays and Strings fundamentals
  • โฑ๏ธ Daily Goal: 1-2 problems with deep understanding
  • ๐Ÿง  Complexity Analysis: Time and space for every solution

Learning Milestones

  • Foundation Phase - Master basic data structures (Arrays, Strings, LinkedLists)
  • Pattern Recognition - Identify common algorithmic patterns
  • Optimization Phase - Focus on time/space complexity improvements
  • Advanced Topics - Trees, Graphs, Dynamic Programming
  • Interview Readiness - Solve 150+ problems across all difficulty levels

๐Ÿ”ฎ Roadmap

Short Term (1-3 months)

  • Complete Arrays & Strings fundamentals
  • Implement basic LinkedList operations
  • Master Stack & Queue applications
  • Solve 50+ easy problems

Medium Term (3-6 months)

  • Advanced data structures (Trees, Graphs)
  • Dynamic programming basics
  • Solve 100+ problems across difficulties
  • Build problem-solving templates

Long Term (6+ months)

  • Advanced algorithms and optimizations
  • System design problem-solving
  • Contribute to open source DSA projects
  • Mentor other learners

๐Ÿค Contributing

Found a better solution? Have suggestions for improvement? Contributions welcome!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/better-solution)
  3. Add your solution with proper documentation
  4. Include test cases and complexity analysis
  5. Submit a pull request

Contribution Guidelines

  • Follow the established code style and template
  • Include detailed comments and complexity analysis
  • Add comprehensive test cases
  • Ensure solutions are optimal and readable

๐ŸŽ“ Related Resources & Learning Community

Recommended Platforms

Helpful Repositories

Popular JavaScript DSA Repositories

Comprehensive Algorithm Collections

Learning Topics & Collections

Official NamasteDev Ecosystem

Course Repositories

Community & Learning

๐Ÿ“„ License

This project is open source and available under the MIT License.


๐ŸŽฏ Daily Practice โ€ข ๐Ÿง  Deep Learning โ€ข ๐Ÿš€ Consistent Growth

"The expert in anything was once a beginner who refused to give up."

๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Suggest Problem โ€ข ๐Ÿ‘จโ€๐Ÿ’ป Follow Journey

Keep Coding, Keep Growing! ๐ŸŒฑ