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,5 +1,5 @@
---
id: max-total-reward
id: 3181-max-total-reward
title: Maximum Total Reward Using Operations
level: hard
sidebar_label: Max Total Reward
Expand Down
8 changes: 8 additions & 0 deletions dsa/basic-topics/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Basic Topics",
"position": 2,
"link": {
"type": "generated-index",
"description": "In this section, you will find topics that are essential to understanding the basics of the DSA and how to start your DSA learning journey."
}
}
8 changes: 8 additions & 0 deletions dsa/basic-topics/arrays/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Arrays",
"position": 5,
"link": {
"type": "generated-index",
"description": "In this section, you will learn about arrays and how to use them in your programs."
}
}
6 changes: 6 additions & 0 deletions dsa/basic-topics/arrays/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: introduction-to-array
title: Introduction to Arrays
sidebar_label: Introduction to Arrays
sidebar_position: 1
---
Empty file.
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions dsa/basic-topics/backtracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: backtracking
title: Backtracking
sidebar_label: Backtracking
sidebar_position: 6
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/binary-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: binary-search
title: Binary Search
sidebar_label: Binary Search
sidebar_position: 7
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/brute-force.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: brute-force
title: Brute Force Algorithm
sidebar_label: Brute Force
sidebar_position: 8
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/greedy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: greedy
title: Greedy Algorithms
sidebar_label: Greedy
sidebar_position: 9
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/hash-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: hash-map
title: Hash Map
sidebar_label: Hash Map
sidebar_position: 10
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/heap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: heap
title: Heap (Priority Queue)
sidebar_label: Heap
sidebar_position: 11
---
58 changes: 58 additions & 0 deletions dsa/basic-topics/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
id: introduction-to-data-structures-and-algorithms
title: Introduction to Data Structures and Algorithms
sidebar_label: Introduction to DSA
sidebar_position: 1
---

Data Structures and Algorithms (DSA) is a fundamental part of computer science. It is the study of data structures and algorithms that are used to solve problems. Data structures are a way of organizing and storing data so that it can be accessed and modified efficiently. Algorithms are a set of instructions that are used to solve problems.

## Why Study Data Structures and Algorithms?

Data structures and algorithms are the building blocks of computer programs. They are used to solve complex problems efficiently. Here are some reasons why you should study data structures and algorithms:

1. **Efficiency**: Data structures and algorithms help you write efficient code. By choosing the right data structure and algorithm, you can reduce the time and space complexity of your code.
2. **Problem Solving**: Data structures and algorithms help you solve complex problems. They provide a systematic way to approach problems and find solutions.
3. **Performance**: Data structures and algorithms help you write code that performs well. By understanding how data structures and algorithms work, you can write code that is fast and efficient.
4. **Interviews**: Data structures and algorithms are an important topic in technical interviews. Many companies ask questions related to data structures and algorithms in their interviews.
5. **Foundation**: Data structures and algorithms are the foundation of computer science. By studying data structures and algorithms, you will develop a strong foundation in computer science.
6. **Learning**: Data structures and algorithms are interesting topics to study. They provide insights into how computers work and how problems can be solved using computers.
7. **Career**: Data structures and algorithms are essential skills for a career in software development. By mastering data structures and algorithms, you can become a better programmer and advance your career.
8. **Problem Solving Skills**: Data structures and algorithms help you develop problem-solving skills. By studying data structures and algorithms, you will learn how to break down complex problems into smaller, more manageable problems.
9. **Creativity**: Data structures and algorithms are a creative field. They require you to think creatively and come up with innovative solutions to problems.

## Topics in Data Structures and Algorithms

Data structures and algorithms cover a wide range of topics. Some of the key topics in data structures and algorithms include:

1. **Arrays**: Arrays are a fundamental data structure that stores a collection of elements in contiguous memory locations.
2. **Linked Lists**: Linked lists are a data structure that consists of a sequence of elements where each element points to the next element in the sequence.
3. **Stacks**: Stacks are a data structure that follows the Last In First Out (LIFO) principle, where the last element added is the first element removed.
4. **Queues**: Queues are a data structure that follows the First In First Out (FIFO) principle, where the first element added is the first element removed.
5. **Trees**: Trees are a hierarchical data structure that consists of nodes connected by edges. They are used to represent hierarchical relationships between elements.
6. **Graphs**: Graphs are a data structure that consists of a set of vertices connected by edges. They are used to represent relationships between elements.
7. **Sorting Algorithms**: Sorting algorithms are algorithms that arrange elements in a specific order. Some common sorting algorithms include Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort.
8. **Searching Algorithms**: Searching algorithms are algorithms that find a specific element in a collection of elements. Some common searching algorithms include Linear Search, Binary Search, Depth First Search (DFS), and Breadth First Search (BFS).
9. **Recursion**: Recursion is a programming technique where a function calls itself to solve a problem. It is used to solve problems that can be broken down into smaller, more manageable subproblems.
10. **Dynamic Programming**: Dynamic programming is a method for solving complex problems by breaking them down into simpler subproblems. It is used to solve optimization problems where the solution can be obtained by combining solutions to subproblems.
11. **Greedy Algorithms**: Greedy algorithms are algorithms that make a series of choices that are locally optimal at each step with the hope of finding a global optimum solution.
12. **Divide and Conquer**: Divide and conquer is a problem-solving technique where a problem is divided into smaller subproblems that are solved independently. The solutions to the subproblems are then combined to solve the original problem.
13. **Backtracking**: Backtracking is a problem-solving technique where a solution is built incrementally by making a series of choices. If a choice leads to a dead end, the algorithm backtracks and makes a different choice.
14. **Hashing**: Hashing is a technique that is used to map data to a fixed-size array. It is used to store and retrieve data quickly.
15. **Trie**: Trie is a tree-like data structure that is used to store a dynamic set of strings. It is used to efficiently store and search for strings.
16. **Segment Trees**: Segment trees are a data structure that is used to store information about intervals or segments. They are used to perform range queries efficiently.
17. **Binary Indexed Trees (Fenwick Trees)**: Binary Indexed Trees, also known as Fenwick Trees, are a data structure that is used to perform range queries and updates efficiently.

These are just a few of the many topics in data structures and algorithms. By studying these topics, you will gain a deeper understanding of how data structures and algorithms work and how they can be used to solve problems.

## Conclusion

Data structures and algorithms are essential topics in computer science. They provide a systematic way to solve problems efficiently. By studying data structures and algorithms, you will develop problem-solving skills, improve your coding skills, and advance your career in software development. Whether you are a beginner or an experienced programmer, data structures and algorithms are important topics to study. They will help you become a better programmer and solve complex problems more effectively.

---

<h2>Authors:</h2>

{['ajay-dhangar'].map(username => (
<Author key={username} username={username} />
))}
6 changes: 6 additions & 0 deletions dsa/basic-topics/kadane.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: kadane
title: Kadane's Algorithm
sidebar_label: Kadane's
sidebar_position: 12
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/linear-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: linear-search
title: Linear Search
sidebar_label: Linear Search
sidebar_position: 13
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/linked-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: linked-list
title: Linked List
sidebar_label: Linked List
sidebar_position: 14
---
8 changes: 8 additions & 0 deletions dsa/basic-topics/sorting/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Sorting",
"position": 15,
"link": {
"type": "generated-index",
"description": "In this section, you will learn sorting algorithms and how to implement them in different programming languages."
}
}
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/bubble-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: bubble-sort
title: Bubble Sort
sidebar_label: Bubble Sort
sidebar_position: 2
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/cyclic-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: cyclic-sort
title: Cycle Sort
sidebar_label: Cycle Sort
sidebar_position: 3
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/insertion-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: insertion-sort
title: Insertion Sort
sidebar_label: Insertion Sort
sidebar_position: 4
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: introduction-to-sorting
title: Introduction to Sorting
sidebar_label: Sorting Intro
sidebar_position: 1
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/merge-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: merge-sort
title: Merge Sort
sidebar_label: Merge Sort
sidebar_position: 5
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/selection-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: selection-sort
title: Selection Sort
sidebar_label: Selection Sort
sidebar_position: 6
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/shell-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: shell-sort
title: Shell Sort
sidebar_label: Shell Sort
sidebar_position: 7
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/sorting/tim-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: tim-sort
title: Tim Sort
sidebar_label: Tim Sort
sidebar_position: 8
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/space-complexity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: space-complexity
title: Space Complexity
sidebar_label: Space Complexity
sidebar_position: 3
---
8 changes: 8 additions & 0 deletions dsa/basic-topics/strings/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Strings",
"position": 5,
"link": {
"type": "generated-index",
"description": "In this section, you will find information about the String class and its methods."
}
}
6 changes: 6 additions & 0 deletions dsa/basic-topics/strings/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: introduction-to-string
title: Introduction to Stirngs
sidebar_label: Introduction to Strings
sidebar_position: 1
---
6 changes: 6 additions & 0 deletions dsa/basic-topics/time-complexity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: time-complexity
title: Time Complexity
sidebar_label: Time Complexity
sidebar_position: 2
---
8 changes: 0 additions & 8 deletions dsa/beginner/_category_.json

This file was deleted.

8 changes: 0 additions & 8 deletions dsa/intermediate/_category_.json

This file was deleted.

87 changes: 87 additions & 0 deletions src/components/Author/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import React, { useState, useEffect } from 'react';
import styled from 'styled-components';

interface AuthorProps {
username: string;
}

const AuthorContainer = styled.div`
display: flex;
align-items: center;
margin-bottom: 1rem;
`;

const AuthorLink = styled.a`
text-decoration: none;
color: inherit;
display: flex;
align-items: center;

&:hover {
opacity: 0.8;
}
`;

const Avatar = styled.img`
width: 50px;
height: 50px;
border-radius: 50%;
margin-right: 10px;
`;

const AuthorName = styled.span`
font-weight: bold;
`;

const Loading = styled.div`
font-style: italic;
color: #666;
`;

const Error = styled.div`
color: red;
font-weight: bold;
`;

const Author: React.FC<AuthorProps> = ({ username }) => {
const [authorData, setAuthorData] = useState<any>(null);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);

useEffect(() => {
fetch(`https://api.github.com/users/${username}`)
.then(response => {
if (!response.ok) {
throw new Error('Failed to fetch author data');
}
return response.json();
})
.then(data => {
setAuthorData(data);
setIsLoading(false);
})
.catch(error => {
setError(error.message);
setIsLoading(false);
});
}, [username]);

if (isLoading) {
return <Loading>Loading...</Loading>;
}

if (error) {
return <Error>Error: {error}</Error>;
}

return (
<AuthorContainer>
<AuthorLink href={authorData.html_url} target="_blank" rel="noopener noreferrer">
<Avatar src={authorData.avatar_url} alt={authorData.name} />
<AuthorName>{authorData.name || authorData.login}</AuthorName>
</AuthorLink>
</AuthorContainer>
);
};

export default Author;
6 changes: 0 additions & 6 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@
no-repeat;
}

.header-github-link:hover::before {
transform: scale(1.05);
border-radius: 50%;
border: 2px solid green;
box-shadow: 0 4px 8px rgba(0, 255, 0, 0.6);
}

[data-theme='dark'] .header-github-link::before {
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
Expand Down
4 changes: 3 additions & 1 deletion src/theme/MDXComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Lesson from '@site/src/components/Lesson';
import Image from '@theme/IdealImage';
import LiteYouTubeEmbed from "react-lite-youtube-embed";
import "react-lite-youtube-embed/dist/LiteYouTubeEmbed.css";
import Author from '@site/src/components/Author';

export default {
// Re-use the default mapping
Expand All @@ -46,5 +47,6 @@ export default {
File,
Lesson,
Image,
LiteYouTubeEmbed
LiteYouTubeEmbed,
Author
};