Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Algorithms",
"position": 2
"position": 3
}
4 changes: 2 additions & 2 deletions docs/data-structure-and-algorithms/algorithms/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 6 additions & 6 deletions docs/data-structure-and-algorithms/algorithms/sliding-window.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 3
---

# Sliding Window
Expand All @@ -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`.
Expand Down Expand Up @@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Data Structure",
"position": 2
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Binary Search Tree",
"position": 9
"position": 8
}
15 changes: 15 additions & 0 deletions docs/data-structure-and-algorithms/data-structures/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 1
---

# Introduction

:::tip[Status]

This note is complete, reviewed, and considered stable.

:::

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 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.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 7
sidebar_position: 6
---

# Queue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 6
sidebar_position: 5
---

# Stack
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Tree",
"position": 8
"position": 7
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Time and Space Complexity",
"position": 3
"position": 4
}
5 changes: 4 additions & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading