Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added props #46

Merged
merged 1 commit into from
Oct 4, 2024
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
8 changes: 4 additions & 4 deletions docs/complexity/how-to-calculate-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [time-complexity, space-complexity, algorithm-analysis, big-o-notation, ho

Calculating time and space complexity is an essential skill for analyzing the efficiency of algorithms. By understanding how to determine the time and space complexity of an algorithm, you can evaluate its performance and make informed decisions when designing and optimizing algorithms.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## What is Time Complexity?

Expand All @@ -27,7 +27,7 @@ Similar to time complexity, space complexity is also denoted using Big O notatio

Analyzing space complexity involves counting the memory used by an algorithm, including variables, data structures, and other resources. Understanding the space complexity of an algorithm is crucial, especially when dealing with limited memory resources.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## How to Calculate Time Complexity

Expand All @@ -44,7 +44,7 @@ Calculating the time complexity of an algorithm involves analyzing the number of

By following these steps, you can calculate the time complexity of an algorithm and gain insights into its efficiency and performance characteristics.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## How to Calculate Space Complexity

Expand All @@ -63,7 +63,7 @@ Calculating the space complexity of an algorithm involves analyzing the amount o

By following these steps, you can calculate the space complexity of an algorithm and evaluate its memory usage, efficiency, and performance characteristics.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## Conclusion

Expand Down
6 changes: 6 additions & 0 deletions docs/complexity/space-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ tags: [Space Complexity, Big O Notation, Memory, Algorithm, Complexity Analysis,

Space complexity is a measure of the amount of working storage an algorithm needs. It is a measure of the amount of memory space an algorithm needs to solve a problem as a function of the size of the input to the problem. It is the amount of memory space required by the algorithm to execute in its life cycle.

<AdsComponent adSlot="3270832720" />

## Why is Space Complexity important?

Space complexity is important because the memory that is allocated to the program is limited. If the program uses more memory than the available memory, the program will crash. Therefore, it is important to know the space complexity of the algorithm.
Expand All @@ -31,6 +33,8 @@ function sumOfN(n) {

In the above example, the space complexity of the algorithm is O(1) because the algorithm uses a constant amount of memory space.

<AdsComponent adSlot="5461416177" />

## Example of Space Complexity

1. Write a program to fine maximum and minimum element in an array.
Expand Down Expand Up @@ -207,6 +211,8 @@ In the above example, the space complexity of the algorithm is `O(1) + O(n) = O(

:::

<AdsComponent adSlot="5461416177" />

## Conclusion

Space complexity is a measure of the amount of working storage an algorithm needs. It is a measure of the amount of memory space an algorithm needs to solve a problem as a function of the size of the input to the problem. It is the amount of memory space required by the algorithm to execute in its life cycle.
10 changes: 5 additions & 5 deletions docs/complexity/time-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [time complexity, big o notation, algorithm, complexity analysis, data str

Time Complexity is a measure of the amount of time an algorithm takes to solve a problem as a function of the size of the input to the problem. It is commonly estimated by counting the number of elementary operations performed by the algorithm, where an elementary operation takes a fixed amount of time to perform.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Why is Time Complexity Important?

Expand All @@ -23,7 +23,7 @@ The most common notations used to represent the time complexity of an algorithm
- **Omega Notation (Ω):** It represents the lower bound of the time complexity of an algorithm. It gives the best-case time complexity of an algorithm.
- **Theta Notation (Θ):** It represents the average-case time complexity of an algorithm. It gives the tight bound of the time complexity of an algorithm.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

### Big O Notation (O)

Expand All @@ -47,7 +47,7 @@ Theta Notation is used to represent the average-case time complexity of an algor

The Theta Notation is written as `Θ(f(n))`, where `f(n)` is a function that represents the time complexity of the algorithm. It is read as "Theta of f of n".

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Examples of Time Complexity

Expand All @@ -71,7 +71,7 @@ Here are some examples of time complexity for different algorithms:
- **Exponential Factorial Exponential Time (O(2^n!^2^n)):** An algorithm that takes time proportional to an exponential function of the factorial of an exponential function of the size of the input.
- **Exponential Exponential Factorial Time (O(2^2^n!)):** An algorithm that takes time proportional to an exponential function of an exponential function of the factorial of the size of the input.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## Analyzing Time Complexity

Expand Down Expand Up @@ -303,7 +303,7 @@ Each of the above code snippets has a time complexity of `O(n)` because the numb

**Exlpanation:** The time complexity of the given code is `O(n)` because the loop iterates through the array elements one by one, and the number of iterations is directly proportional to the size of the input array. Therefore, the time complexity is linear, i.e., `O(n)`.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

:::info
**Note:** The time complexity of an algorithm can be different for different programming languages, but the underlying logic and analysis remain the same.
Expand Down
6 changes: 3 additions & 3 deletions docs/complexity/time-space-complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [time-complexity, space-complexity, time vs space complexity]

Time and space complexity are two important concepts in computer science. Time complexity is the amount of time an algorithm takes to run, while space complexity is the amount of memory an algorithm uses. Both are important to consider when analyzing the efficiency of an algorithm.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Time vs Space Complexity

Expand All @@ -32,7 +32,7 @@ Time complexity is typically denoted using Big O notation, which describes the u

Analyzing time complexity involves counting the number of operations an algorithm performs as a function of the input size. This analysis helps us compare different algorithms and determine which one is more efficient for a given problem.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

### Space Complexity

Expand All @@ -50,7 +50,7 @@ For example, consider a sorting algorithm that uses additional memory to store i

Understanding the trade-offs between time and space complexity is key to designing efficient algorithms that meet the performance requirements of a given problem.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Conclusion

Expand Down
4 changes: 2 additions & 2 deletions docs/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [dsa, data structures, algorithms]

Let's delve into the world of Data Structures and Algorithms (DSA) with Algo's comprehensive learning resources. From fundamental concepts to advanced topics, Algo provides a structured pathway to help you master DSA and enhance your programming skills. Whether you're a beginner or an experienced coder, Algo is here to guide you through the intricate world of DSA.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Expand Down Expand Up @@ -111,7 +111,7 @@ import TabItem from '@theme/TabItem';
</TabItem>
</Tabs>

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## What Sets Algo Apart?

Expand Down
4 changes: 2 additions & 2 deletions docs/dsa/imp-of-dsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [dsa, data-structures, algorithms, importance of dsa]

Data Structures and Algorithms (DSA) are the building blocks of computer science. They are essential for writing efficient code and solving complex problems. DSA is a fundamental part of computer science and software engineering. It is used in various fields such as software development, machine learning, data science, and many more.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Importance of Data Structures and Algorithms

Expand Down Expand Up @@ -49,7 +49,7 @@ Data Structures and Algorithms are important for the following reasons:
32. **Software Engineering Principles**: DSA is important for software engineering principles. It helps in designing efficient algorithms and data structures for building robust and scalable software systems.
33. **Computer Science Fundamentals**: DSA is essential for computer science fundamentals. It helps in understanding the core concepts of programming, problem-solving, and algorithm design.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## Conclusion

Expand Down
10 changes: 5 additions & 5 deletions docs/dsa/what-is-dsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [dsa, data structures, algorithms, what is dsa]

Data Structures and Algorithms (DSA) are fundamental concepts in computer science and programming. They provide a systematic way to organize and store data efficiently, as well as develop algorithms to solve complex problems. Understanding DSA is crucial for any aspiring programmer or software developer, as it forms the backbone of various applications and systems.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## What Are Data Structures?

Expand All @@ -29,7 +29,7 @@ Data structures are specialized formats for organizing, storing, and managing da
- **Sets**: Data structures that store unique elements without duplicates.
- **Maps**: Data structures that store key-value pairs with unique keys.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## What Are Algorithms?

Expand All @@ -55,7 +55,7 @@ Algorithms are step-by-step procedures or instructions for solving problems and
- **String Matching Algorithms**: Algorithms that find occurrences of a pattern within a text (e.g., Knuth-Morris-Pratt algorithm, Rabin-Karp algorithm).
- **Geometric Algorithms**: Algorithms that solve geometric problems (e.g., convex hull, closest pair of points).

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Why Are Data Structures and Algorithms Important?

Expand All @@ -77,7 +77,7 @@ Data Structures and Algorithms are essential components of computer science and
14. **Innovation and Creativity**: Mastering data structures and algorithms empowers programmers to innovate, create new solutions, and address real-world challenges with computational thinking and problem-solving skills.
15. **Community Support**: DSA communities, forums, and resources provide programmers with opportunities to learn, share, and collaborate on data structures and algorithms, fostering a culture of continuous improvement and knowledge sharing.

<AdsComponent />
<AdsComponent adSlot="5461416177" />

## How Can Data Structures and Algorithms Enhance Your Coding Skills?

Expand All @@ -93,7 +93,7 @@ Learning data structures and algorithms can enhance your coding skills in the fo
8. **Collaborative Learning**: DSA communities, study groups, and coding platforms provide opportunities for collaborative learning, mentorship, and peer support, helping you grow as a programmer and expand your knowledge base.
9. **Continuous Improvement**: DSA learning is a continuous process that allows you to refine your coding skills, explore new algorithms, and stay updated with the latest trends and developments in the field of computer science.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## Conclusion

Expand Down
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags: [dsa, data structures, algorithms]

Algo is your gateway to mastering Data Structures and Algorithms (DSA). Whether you're a coding enthusiast, a student, or a professional looking to enhance your programming skills, Algo is here to guide you through the intricate world of DSA.

<AdsComponent />
<AdsComponent adSlot="3270832720" />

## What Sets Algo Apart?

Expand All @@ -22,6 +22,8 @@ Algo provides carefully curated learning pathways designed to take you from a DS

Learning by doing is at the heart of Algo. Engage in hands-on coding challenges that reinforce your understanding of key concepts. Our interactive platform allows you to apply what you've learned in a practical and engaging manner.

<AdsComponent adSlot="5461416177" />

### Supportive Community

Join a vibrant community of learners, mentors, and industry experts who are passionate about DSA. Collaborate, share knowledge, and grow together as you embark on your coding journey.
Expand Down
11 changes: 9 additions & 2 deletions docs/languages/javascript/ex-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sidebar_label: Variables in JS

Hey, everyone! I'm Ajay Dhangar, and today we're delving into a fundamental concept in JavaScript – Variables. Whether you're a beginner or seeking a refresher, this comprehensive guide will provide you with a solid understanding of JavaScript variables. Let's jump right in!

<AdsComponent adSlot="3270832720" />

## 1. What are Variables?

In the world of programming, variables act as containers. Think of them like labeled boxes that hold various types of information in your program. These containers allow you to store, retrieve, and manipulate data, providing the foundation for dynamic and interactive code.
Expand Down Expand Up @@ -77,6 +79,8 @@ In programming, variables are used to store and manage data. They act as symboli
- They are block-scoped like variables declared with let.
:::

<AdsComponent adSlot="5461416177" />

## 2. Variable Declaration and Types

Now, let's explore how to declare variables and the different types available in JavaScript.
Expand Down Expand Up @@ -126,6 +130,8 @@ Once a variable is declared, you can assign values to it. JavaScript's dynamic t

This flexibility is powerful, but it's crucial to be aware of the data types your variables hold to avoid unexpected behavior.

<AdsComponent adSlot="3270832720" />

## 3. Scope and Hoisting

Understanding the scope of variables is crucial for writing robust and error-free code. JavaScript has function-scoped variables with 'var' and block-scoped variables with 'let' and 'const.'
Expand Down Expand Up @@ -169,6 +175,8 @@ let message = greet("Algo");
console.log(message); // Outputs: Hello, Algo!
```

<AdsComponent adSlot="5461416177" />

## 5. Best Practices

Before we wrap up, let's discuss some best practices for working with variables in JavaScript.
Expand All @@ -192,5 +200,4 @@ var oldWay = "I'm using var.";
let modernWay = "I'm using let.";
```

***Congratulations! You've now gained a comprehensive understanding of variables in JavaScript.***

***Congratulations! You've now gained a comprehensive understanding of variables in JavaScript.***
6 changes: 6 additions & 0 deletions docs/languages/javascript/ex-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ title: Data Type in JavaScript
sidebar_label: Data Type in JS
---

Data types are an essential concept in programming languages like JavaScript. They define the type of data that can be stored and manipulated in a program. Understanding data types is crucial for writing efficient and bug-free code. Let's explore the different data types in JavaScript:

<AdsComponent adSlot="3270832720" />

## 1. **Primitive Data Types:**
These are the basic building blocks of data.

Expand Down Expand Up @@ -66,6 +70,8 @@ sidebar_label: Data Type in JS
};
```

<AdsComponent adSlot="5461416177" />

## 3. **Special Data Types:**
### Function:
- A reusable block of code.
Expand Down
18 changes: 18 additions & 0 deletions docs/languages/javascript/ex-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sidebar_label: Operator in JS

Operators are symbols that perform operations on operands. JavaScript supports various types of operators, including arithmetic, assignment, comparison, logical, and more. Let's explore some common operators used in JavaScript:

<AdsComponent adSlot="3270832720" />

## 1. **Arithmetic Operators:**

Arithmetic operators are used to perform mathematical calculations.
Expand Down Expand Up @@ -51,6 +53,8 @@ The modulus operator returns the remainder of the division operation.
let remainder = 15 % 4; // remainder = 3
```

<AdsComponent adSlot="5461416177" />

## 2. **Assignment Operators:**

Assignment operators are used to assign values to variables.
Expand Down Expand Up @@ -81,6 +85,8 @@ let z = 10;
z -= 2; // z = 8
```

<AdsComponent adSlot="3270832720" />

## 3. **Comparison Operators:**

Comparison operators are used to compare two values.
Expand Down Expand Up @@ -125,6 +131,8 @@ The less than operator checks if the left operand is less than the right operand
let isLessThan = 5 < 10; // isLessThan = true
```

<AdsComponent adSlot="5461416177" />

## 4. **Logical Operators:**

Logical operators are used to combine multiple conditions.
Expand Down Expand Up @@ -161,6 +169,8 @@ let condition = true;
let result = !condition; // result = false
```

<AdsComponent adSlot="3270832720" />

## 5. **Ternary Operator:**

The ternary operator is a shorthand for an `if...else` statement.
Expand Down Expand Up @@ -194,6 +204,8 @@ count++; // count = 6
count--; // count = 5
```

<AdsComponent adSlot="5461416177" />

## 8. **Bitwise Operators:**

Bitwise operators perform operations on binary representations of numbers.
Expand Down Expand Up @@ -254,6 +266,8 @@ Shifts the bits of a number to the right, filling the leftmost bits with zeros.
let result = 5 >>> 1; // result = 2
```

<AdsComponent adSlot="3270832720" />

## 9. **Conditional Operator:**

The conditional operator (`?:`) is a ternary operator that evaluates a condition and returns one of two values based on the result.
Expand All @@ -264,6 +278,8 @@ let age = 20;
let message = age >= 18 ? 'You can vote' : 'You are too young to vote';
```

<AdsComponent adSlot="3270832720" />

## 10. **Comma Operator:**

The comma operator allows multiple expressions to be evaluated in a single statement.
Expand Down Expand Up @@ -316,6 +332,8 @@ let date = new Date();
let isDate = date instanceof Date; // isDate = true
```

<AdsComponent adSlot="5461416177" />

## More Resources:

- [MDN Web Docs: Expressions and Operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators)
Expand Down
Loading
Loading