From eec9e6657d6e978d8fae67958f54cc590f34a5b6 Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 16 Jan 2026 20:14:22 +0530 Subject: [PATCH 1/2] IMDEEPMIND-17: Add comprehensive documentation for tree data structures and algorithms - Introduced a detailed overview of Binary Trees, including properties, types, and mathematical concepts like Catalan numbers. - Added common algorithms for generating binary trees from traversal data and counting nodes, leaf nodes, height, and levels. - Created separate sections for Full vs Complete Binary Trees, Strict Binary Trees, and N-ary Trees, highlighting their definitions, properties, and differences. - Implemented tree representation methods in memory, covering both array and linked representations. - Documented various tree traversal techniques, including Depth-First and Breadth-First traversals, with Python code examples and complexity analysis. --- .../algorithms/_category_.json | 2 +- .../algorithms/sliding-window.md | 12 +++++----- .../data-structures/_category_.json | 4 ++++ .../{algorithms => data-structures}/arrays.md | 0 .../bst/_category_.json | 2 +- .../bst/introduction.md | 0 .../bst/key-operations.md | 0 .../hash-table.md} | 0 .../data-structures/introduction.md | 15 +++++++++++++ .../{algorithms => data-structures}/queue.md | 2 +- .../{algorithms => data-structures}/stack.md | 22 +++++++++---------- .../tree/_category_.json | 2 +- .../tree/binary-tree.md | 0 .../tree/common-algorithms.md | 0 .../tree/full-vs-complete-binary-tree.md | 0 .../tree/introduction.md | 0 .../tree/n-ary-tree.md | 0 .../tree/strict-binary-tree.md | 0 .../tree/strict-vs-complete-binary-tree.md | 0 .../tree/tree-representation.md | 0 .../tree/tree-traversal.md | 0 .../time-space-complexity/_category_.json | 2 +- docs/intro.md | 5 ++++- docusaurus.config.ts | 2 +- 24 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 docs/data-structure-and-algorithms/data-structures/_category_.json rename docs/data-structure-and-algorithms/{algorithms => data-structures}/arrays.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/bst/_category_.json (69%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/bst/introduction.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/bst/key-operations.md (100%) rename docs/data-structure-and-algorithms/{algorithms/hashing.md => data-structures/hash-table.md} (100%) create mode 100644 docs/data-structure-and-algorithms/data-structures/introduction.md rename docs/data-structure-and-algorithms/{algorithms => data-structures}/queue.md (99%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/stack.md (84%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/_category_.json (58%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/binary-tree.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/common-algorithms.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/full-vs-complete-binary-tree.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/introduction.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/n-ary-tree.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/strict-binary-tree.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/strict-vs-complete-binary-tree.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/tree-representation.md (100%) rename docs/data-structure-and-algorithms/{algorithms => data-structures}/tree/tree-traversal.md (100%) diff --git a/docs/data-structure-and-algorithms/algorithms/_category_.json b/docs/data-structure-and-algorithms/algorithms/_category_.json index 06cc2715..11226b38 100644 --- a/docs/data-structure-and-algorithms/algorithms/_category_.json +++ b/docs/data-structure-and-algorithms/algorithms/_category_.json @@ -1,4 +1,4 @@ { "label": "Algorithms", - "position": 2 + "position": 3 } diff --git a/docs/data-structure-and-algorithms/algorithms/sliding-window.md b/docs/data-structure-and-algorithms/algorithms/sliding-window.md index d92fccee..cf6efe2d 100644 --- a/docs/data-structure-and-algorithms/algorithms/sliding-window.md +++ b/docs/data-structure-and-algorithms/algorithms/sliding-window.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 3 --- # Sliding Window @@ -10,12 +10,12 @@ This approach reduces the time complexity of problems that would otherwise requi ## Types of Sliding Windows -1. **Fixed-Sized Window**: +1. **Fixed-Sized Window**: - The window size remains constant while sliding. - Example: Maximum sum of subarray of size `k`. -2. **Dynamic-Sized Window**: +2. **Dynamic-Sized Window**: - The window size changes based on conditions (e.g., constraints on the sum, distinct elements). - Example: Smallest subarray with a sum greater than `x`. @@ -161,9 +161,9 @@ def count_distinct_in_window(arr, k): ## When to Use Sliding Window -1. **Subarray or Substring Problems**: +1. **Subarray or Substring Problems**: - Finding ranges or subsequences with specific constraints. -2. **Optimizations**: +2. **Optimizations**: - Maximizing or minimizing a property within a range. -3. **Frequency Tracking**: +3. **Frequency Tracking**: - Counting occurrences or distinct elements within a window. diff --git a/docs/data-structure-and-algorithms/data-structures/_category_.json b/docs/data-structure-and-algorithms/data-structures/_category_.json new file mode 100644 index 00000000..0bee1d0f --- /dev/null +++ b/docs/data-structure-and-algorithms/data-structures/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Data Structure", + "position": 2 +} diff --git a/docs/data-structure-and-algorithms/algorithms/arrays.md b/docs/data-structure-and-algorithms/data-structures/arrays.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/arrays.md rename to docs/data-structure-and-algorithms/data-structures/arrays.md diff --git a/docs/data-structure-and-algorithms/algorithms/bst/_category_.json b/docs/data-structure-and-algorithms/data-structures/bst/_category_.json similarity index 69% rename from docs/data-structure-and-algorithms/algorithms/bst/_category_.json rename to docs/data-structure-and-algorithms/data-structures/bst/_category_.json index eaf84509..f90454b9 100644 --- a/docs/data-structure-and-algorithms/algorithms/bst/_category_.json +++ b/docs/data-structure-and-algorithms/data-structures/bst/_category_.json @@ -1,4 +1,4 @@ { "label": "Binary Search Tree", - "position": 9 + "position": 8 } diff --git a/docs/data-structure-and-algorithms/algorithms/bst/introduction.md b/docs/data-structure-and-algorithms/data-structures/bst/introduction.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/bst/introduction.md rename to docs/data-structure-and-algorithms/data-structures/bst/introduction.md diff --git a/docs/data-structure-and-algorithms/algorithms/bst/key-operations.md b/docs/data-structure-and-algorithms/data-structures/bst/key-operations.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/bst/key-operations.md rename to docs/data-structure-and-algorithms/data-structures/bst/key-operations.md diff --git a/docs/data-structure-and-algorithms/algorithms/hashing.md b/docs/data-structure-and-algorithms/data-structures/hash-table.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/hashing.md rename to docs/data-structure-and-algorithms/data-structures/hash-table.md diff --git a/docs/data-structure-and-algorithms/data-structures/introduction.md b/docs/data-structure-and-algorithms/data-structures/introduction.md new file mode 100644 index 00000000..d0eacbc3 --- /dev/null +++ b/docs/data-structure-and-algorithms/data-structures/introduction.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 1 +--- + +# Introduction + +:::tip[Status] + +This note is complete, reviewed, and considered stable. + +::: + +Data Structures and Algorithms (DSA) deal with how data is organized in memory and how it is processed efficiently. They form the foundation of writing programs that scale beyond small inputs, where performance, memory usage, and predictability matter. DSA is fundamentally about trade-offs, time versus space, simplicity versus efficiency and choosing the right approach based on how data is accessed and modified. Rather than memorizing solutions, DSA builds the ability to reason about efficiency, understand how code behaves as input grows, and design systems that remain reliable under load. + +Here in the notes, We'll including notes on various data strcutures and algorithms. We will discuss how each data structure and algorithm works, their trade-offs, their performance, etc. diff --git a/docs/data-structure-and-algorithms/algorithms/queue.md b/docs/data-structure-and-algorithms/data-structures/queue.md similarity index 99% rename from docs/data-structure-and-algorithms/algorithms/queue.md rename to docs/data-structure-and-algorithms/data-structures/queue.md index a0df3ee4..d8271558 100644 --- a/docs/data-structure-and-algorithms/algorithms/queue.md +++ b/docs/data-structure-and-algorithms/data-structures/queue.md @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 6 --- # Queue diff --git a/docs/data-structure-and-algorithms/algorithms/stack.md b/docs/data-structure-and-algorithms/data-structures/stack.md similarity index 84% rename from docs/data-structure-and-algorithms/algorithms/stack.md rename to docs/data-structure-and-algorithms/data-structures/stack.md index c03fbad3..e604c735 100644 --- a/docs/data-structure-and-algorithms/algorithms/stack.md +++ b/docs/data-structure-and-algorithms/data-structures/stack.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 5 --- # Stack @@ -21,9 +21,9 @@ Stacks can be visualized as a collection of elements piled one on top of another Stacks can be implemented using: -1. **Arrays or Lists**: Most commonly used in high-level programming languages like Python. -2. **Linked Lists**: Useful for dynamic memory allocation. -3. **Built-in Libraries**: Many languages have built-in stack implementations (e.g., Python's `deque`). +1. **Arrays or Lists**: Most commonly used in high-level programming languages like Python. +2. **Linked Lists**: Useful for dynamic memory allocation. +3. **Built-in Libraries**: Many languages have built-in stack implementations (e.g., Python's `deque`). ## Use Cases @@ -144,9 +144,9 @@ def next_greater_elements(nums): ## Advantages of Using Stacks -1. **Simple to Use**: Offers a straightforward way to manage LIFO behavior. -2. **Efficient**: Push and pop operations are O(1). -3. **Versatile**: Useful in diverse algorithms like DFS, backtracking, and expression evaluation. +1. **Simple to Use**: Offers a straightforward way to manage LIFO behavior. +2. **Efficient**: Push and pop operations are O(1). +3. **Versatile**: Useful in diverse algorithms like DFS, backtracking, and expression evaluation. ## Limitations of Stacks @@ -156,7 +156,7 @@ def next_greater_elements(nums): ## When to Use Stacks -1. **Reversible Processes**: Undo/redo operations, tracking states. -2. **Nested Structures**: Parentheses matching, XML/HTML tag validation. -3. **Recursion**: Mimicking recursion with an explicit stack (e.g., DFS). -4. **Order Preservation**: Storing elements temporarily for reversal. +1. **Reversible Processes**: Undo/redo operations, tracking states. +2. **Nested Structures**: Parentheses matching, XML/HTML tag validation. +3. **Recursion**: Mimicking recursion with an explicit stack (e.g., DFS). +4. **Order Preservation**: Storing elements temporarily for reversal. diff --git a/docs/data-structure-and-algorithms/algorithms/tree/_category_.json b/docs/data-structure-and-algorithms/data-structures/tree/_category_.json similarity index 58% rename from docs/data-structure-and-algorithms/algorithms/tree/_category_.json rename to docs/data-structure-and-algorithms/data-structures/tree/_category_.json index b1c5c3f0..d9204914 100644 --- a/docs/data-structure-and-algorithms/algorithms/tree/_category_.json +++ b/docs/data-structure-and-algorithms/data-structures/tree/_category_.json @@ -1,4 +1,4 @@ { "label": "Tree", - "position": 8 + "position": 7 } diff --git a/docs/data-structure-and-algorithms/algorithms/tree/binary-tree.md b/docs/data-structure-and-algorithms/data-structures/tree/binary-tree.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/binary-tree.md rename to docs/data-structure-and-algorithms/data-structures/tree/binary-tree.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/common-algorithms.md b/docs/data-structure-and-algorithms/data-structures/tree/common-algorithms.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/common-algorithms.md rename to docs/data-structure-and-algorithms/data-structures/tree/common-algorithms.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/full-vs-complete-binary-tree.md b/docs/data-structure-and-algorithms/data-structures/tree/full-vs-complete-binary-tree.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/full-vs-complete-binary-tree.md rename to docs/data-structure-and-algorithms/data-structures/tree/full-vs-complete-binary-tree.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/introduction.md b/docs/data-structure-and-algorithms/data-structures/tree/introduction.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/introduction.md rename to docs/data-structure-and-algorithms/data-structures/tree/introduction.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/n-ary-tree.md b/docs/data-structure-and-algorithms/data-structures/tree/n-ary-tree.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/n-ary-tree.md rename to docs/data-structure-and-algorithms/data-structures/tree/n-ary-tree.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/strict-binary-tree.md b/docs/data-structure-and-algorithms/data-structures/tree/strict-binary-tree.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/strict-binary-tree.md rename to docs/data-structure-and-algorithms/data-structures/tree/strict-binary-tree.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/strict-vs-complete-binary-tree.md b/docs/data-structure-and-algorithms/data-structures/tree/strict-vs-complete-binary-tree.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/strict-vs-complete-binary-tree.md rename to docs/data-structure-and-algorithms/data-structures/tree/strict-vs-complete-binary-tree.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/tree-representation.md b/docs/data-structure-and-algorithms/data-structures/tree/tree-representation.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/tree-representation.md rename to docs/data-structure-and-algorithms/data-structures/tree/tree-representation.md diff --git a/docs/data-structure-and-algorithms/algorithms/tree/tree-traversal.md b/docs/data-structure-and-algorithms/data-structures/tree/tree-traversal.md similarity index 100% rename from docs/data-structure-and-algorithms/algorithms/tree/tree-traversal.md rename to docs/data-structure-and-algorithms/data-structures/tree/tree-traversal.md diff --git a/docs/data-structure-and-algorithms/time-space-complexity/_category_.json b/docs/data-structure-and-algorithms/time-space-complexity/_category_.json index 7585666d..c2e6d8f1 100644 --- a/docs/data-structure-and-algorithms/time-space-complexity/_category_.json +++ b/docs/data-structure-and-algorithms/time-space-complexity/_category_.json @@ -1,4 +1,4 @@ { "label": "Time and Space Complexity", - "position": 3 + "position": 4 } diff --git a/docs/intro.md b/docs/intro.md index 125dd827..9fd0c9a9 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -153,10 +153,13 @@ If you come across any issues or errors in the notes, feel free to open an issue ### Data Structure and Algorithms 1. [Data Structure and Algorithms](/docs/data-structure-and-algorithms/introduction.md) + 1. [Data Structures](/docs/data-structure-and-algorithms/data-structures/introduction.md) + 1. [Introduction](/docs/data-structure-and-algorithms/data-structures/introduction.md) + 2. [Arrays](/docs/data-structure-and-algorithms/data-structures/arrays.md) + 3. [Hash Table](/docs/data-structure-and-algorithms/data-structures/hash-table.md) 1. [Algorithms](/docs/data-structure-and-algorithms/algorithms/introduction.md) 1. [Introduction](/docs/data-structure-and-algorithms/algorithms/introduction.md) 2. [Recursion](/docs/data-structure-and-algorithms/algorithms/recursion.md) - 3. [Arrays](/docs/data-structure-and-algorithms/algorithms/arrays.md) 2. [Time and Space Complexity](/docs/data-structure-and-algorithms/introduction.md) ### Operating Systems diff --git a/docusaurus.config.ts b/docusaurus.config.ts index bd86e3b1..4375f471 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -179,7 +179,7 @@ const config: Config = { ], }, ], - copyright: `Copyright © ${new Date().getFullYear()} Abhishek Chatterjee. Built with Docusaurus.`, + copyright: `Copyright © ${new Date().getFullYear()} Abhishek Chatterjee. Last built on ${new Date().toLocaleDateString()}. Built with Docusaurus.`, }, prism: { theme: prismThemes.github, From 52426a2ccf263d80af78fbf7bde6253849a026e0 Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 16 Jan 2026 20:16:20 +0530 Subject: [PATCH 2/2] IMDEEPMIND-17: Refactor introduction documentation for data structures and algorithms to enhance clarity and correctness. Updated descriptions and fixed typographical errors. --- docs/data-structure-and-algorithms/algorithms/introduction.md | 4 ++-- .../data-structures/introduction.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/data-structure-and-algorithms/algorithms/introduction.md b/docs/data-structure-and-algorithms/algorithms/introduction.md index d0eacbc3..768776aa 100644 --- a/docs/data-structure-and-algorithms/algorithms/introduction.md +++ b/docs/data-structure-and-algorithms/algorithms/introduction.md @@ -10,6 +10,6 @@ This note is complete, reviewed, and considered stable. ::: -Data Structures and Algorithms (DSA) deal with how data is organized in memory and how it is processed efficiently. They form the foundation of writing programs that scale beyond small inputs, where performance, memory usage, and predictability matter. DSA is fundamentally about trade-offs, time versus space, simplicity versus efficiency and choosing the right approach based on how data is accessed and modified. Rather than memorizing solutions, DSA builds the ability to reason about efficiency, understand how code behaves as input grows, and design systems that remain reliable under load. +Algorithms deal with how data is processed efficiently and how problems are solved systematically. They form the foundation of writing programs that scale beyond small inputs, where performance, memory usage, and predictability matter. Algorithms are fundamentally about trade-offs, time versus space, simplicity versus efficiency and choosing the right approach based on the problem at hand. Rather than memorizing solutions, learning algorithms builds the ability to reason about efficiency, understand how code behaves as input grows, and design systems that remain reliable under load. -Here in the notes, We'll including notes on various data strcutures and algorithms. We will discuss how each data structure and algorithm works, their trade-offs, their performance, etc. +Here in the notes, we'll include notes on various algorithms. We will discuss how each algorithm works, their trade-offs, their performance characteristics, and when to use them. diff --git a/docs/data-structure-and-algorithms/data-structures/introduction.md b/docs/data-structure-and-algorithms/data-structures/introduction.md index d0eacbc3..976567b4 100644 --- a/docs/data-structure-and-algorithms/data-structures/introduction.md +++ b/docs/data-structure-and-algorithms/data-structures/introduction.md @@ -10,6 +10,6 @@ This note is complete, reviewed, and considered stable. ::: -Data Structures and Algorithms (DSA) deal with how data is organized in memory and how it is processed efficiently. They form the foundation of writing programs that scale beyond small inputs, where performance, memory usage, and predictability matter. DSA is fundamentally about trade-offs, time versus space, simplicity versus efficiency and choosing the right approach based on how data is accessed and modified. Rather than memorizing solutions, DSA builds the ability to reason about efficiency, understand how code behaves as input grows, and design systems that remain reliable under load. +Data Structures are the foundation of how data is organized in memory and accessed efficiently. They form the foundation of writing programs that scale beyond small inputs, where performance, memory usage, and predictability matter. Data Structures are fundamentally about trade-offs, time versus space, simplicity versus efficiency and choosing the right approach based on how data is accessed and modified. Rather than memorizing solutions, understanding data structures builds the ability to reason about efficiency, understand how code behaves as input grows, and design systems that remain reliable under load. -Here in the notes, We'll including notes on various data strcutures and algorithms. We will discuss how each data structure and algorithm works, their trade-offs, their performance, etc. +Here in the notes, we'll include notes on various data structures. We will discuss how each data structure works, their trade-offs, their performance characteristics, and when to use them.