Welcome to my DSA laboratory! π§ͺ This repository is a collection of data structures and algorithms implemented in JavaScript. I am currently following the Codevolution (DSA with JavaScript) curriculum to build a rock-solid foundation in computer science fundamentals.
My objective is to move beyond just "making code work" to writing highly optimized, scalable, and efficient software.
- Fibonacci Sequence
- Factorial of a Number
- Prime Number Check
- Power of Two (Bitwise & Linear)
- Recursion (Basics & Advanced)
- Linear Search
- Binary Search (Iterative & Recursive)
- Bubble Sort
- Insertion Sort
- Quick Sort
- Merge Sort
- Linked Lists (Singly & Doubly)
- Stacks & Queues (Optimized with Objects)
- Hash Tables (Handling Collisions)
- Binary Search Trees (BST)
- Graphs (Adjacency List & Matrix)
Implementing DSA in JavaScript provides unique challenges and insights:
- Memory Management: Understanding how the V8 engine handles objects and arrays.
- Optimization: Learning when to use built-in methods vs. manual loops for better performance.
- Modern Syntax: Leveraging ES6+ features like Classes and Arrow functions.
| Algorithm | Time Complexity | Space Complexity |
|---|---|---|
| Binary Search | ||
| Merge Sort | ||
| Quick Sort | ||
| Bubble Sort |
Each file in this repo is structured for maximum readability:
- The Problem: Description of the challenge.
- The Logic: Explanation of the approach.
- The Implementation: Clean, commented JS code.
- Complexity Analysis: Explicit Time and Space complexity notes.
// Example Structure
function binarySearch(arr, target) {
// Logic here...
}
// Time: O(log n) | Space: O(1)