Skip to content

Commit 84f6014

Browse files
authored
Merge branch 'main' into leetcode-3163
2 parents 2c666e0 + 509c72d commit 84f6014

31 files changed

+1343
-1028
lines changed

blog/Introduction to Cryptography and Cyber security.md renamed to blog/introduction-to-cryptography-and-cyber-security.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Cryptography and Its Use in Cyber Security'
2+
title: "Cryptography and Its Use in Cyber Security"
33
sidebar_label: Cryptography and Cyber Security
44
authors: [pujan-sarkar]
55
tags: [cryptography, cyber security, encryption, technology]
@@ -81,4 +81,3 @@ Zero-knowledge proofs enable one party to prove to another that a statement is t
8181
## Conclusion
8282

8383
Cryptography is a cornerstone of cyber security, providing the means to protect data and maintain privacy in an increasingly interconnected world. As technology advances and new threats emerge, the field of cryptography will continue to evolve, offering innovative solutions to ensure the security and integrity of our digital lives. By understanding and implementing cryptographic techniques, individuals and organizations can safeguard their information and build a secure future.
84-

courses/HTML/advanced-level/Integration-With-JS/Dyanamic-Concept.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ title: "Dynamic Content with JavaScript"
44
sidebar_label: Dynamic Content
55
sidebar_position: 3
66
description: "Learn to Dynamic Content with JavaScript."
7-
tags: [courses,advance-level,Dynamic Content,Introduction]
8-
---
9-
10-
7+
tags: [courses, advance-level, Dynamic Content, Introduction]
8+
---
119

1210
JavaScript allows for dynamic manipulation of HTML content, enabling developers to create interactive web applications. This can involve modifying the DOM, responding to user events, and dynamically generating content.
1311

1412
**1. Changing Text Content:**
13+
1514
```html
1615
<button id="changeText">Change Text</button>
1716
<p id="dynamicText">Original Text</p>
1817

1918
<script>
20-
document.getElementById('changeText').onclick = function() {
21-
document.getElementById('dynamicText').textContent = 'Text Changed!';
22-
};
19+
document.getElementById("changeText").onclick = function () {
20+
document.getElementById("dynamicText").textContent = "Text Changed!";
21+
};
2322
</script>
2423
```
2524

2625
**2. Creating Elements Dynamically:**
26+
2727
```html
2828
<button id="addElement">Add Element</button>
2929
<div id="container"></div>
3030

3131
<script>
32-
document.getElementById('addElement').onclick = function() {
33-
const newElement = document.createElement('p');
34-
newElement.textContent = 'New Element Added!';
35-
document.getElementById('container').appendChild(newElement);
36-
};
32+
document.getElementById("addElement").onclick = function () {
33+
const newElement = document.createElement("p");
34+
newElement.textContent = "New Element Added!";
35+
document.getElementById("container").appendChild(newElement);
36+
};
3737
</script>
3838
```
3939

@@ -45,25 +45,25 @@ Using the Fetch API to retrieve data dynamically from an external source.
4545
<div id="dataContainer"></div>
4646

4747
<script>
48-
document.getElementById('fetchData').onclick = function() {
49-
fetch('https://jsonplaceholder.typicode.com/posts/1')
50-
.then(response => response.json())
51-
.then(data => {
52-
document.getElementById('dataContainer').innerHTML = `
48+
document.getElementById("fetchData").onclick = function () {
49+
fetch("https://jsonplaceholder.typicode.com/posts/1")
50+
.then((response) => response.json())
51+
.then((data) => {
52+
document.getElementById("dataContainer").innerHTML = `
5353
<h2>${data.title}</h2>
5454
<p>${data.body}</p>
5555
`;
56-
});
57-
};
56+
});
57+
};
5858
</script>
5959
```
6060

6161
### Summary Table
6262

63-
| Feature | Description |
64-
|--------------------------------|-------------------------------------------------|
65-
| **Embedding JavaScript** | Inline, internal, or external scripts in HTML. |
66-
| **Using Frameworks** | Integrate HTML with JavaScript frameworks like React. |
67-
| **Dynamic Content** | Modify the DOM, create elements, and fetch data dynamically with JavaScript. |
63+
| Feature | Description |
64+
| ------------------------ | ---------------------------------------------------------------------------- |
65+
| **Embedding JavaScript** | Inline, internal, or external scripts in HTML. |
66+
| **Using Frameworks** | Integrate HTML with JavaScript frameworks like React. |
67+
| **Dynamic Content** | Modify the DOM, create elements, and fetch data dynamically with JavaScript. |
6868

69-
By effectively integrating HTML and JavaScript, developers can create engaging, interactive web applications that enhance user experience and functionality.
69+
By effectively integrating HTML and JavaScript, developers can create engaging, interactive web applications that enhance user experience and functionality.
Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
---
2-
id: lesson-3
2+
id: lesson-2
33
title: "Using HTML with JavaScript Frameworks (e.g., React.js)"
44
sidebar_label: HTML with Frameworks
5-
sidebar_position: 3
5+
sidebar_position: 2
66
description: "Learn to Using HTML with JavaScript Frameworks (e.g., React.js)."
7-
tags: [courses,advance-level,Frameworks,Introduction]
8-
---
9-
10-
7+
tags: [courses, advance-level, Frameworks, Introduction]
8+
---
119

1210
JavaScript frameworks like React.js enable developers to build complex user interfaces using HTML-like syntax (JSX). React components encapsulate HTML and JavaScript, promoting a component-based architecture.
1311

1412
**Basic React Component:**
13+
1514
```javascript
16-
import React from 'react';
15+
import React from "react";
1716

1817
function Greeting() {
19-
return <h1>Hello, World!</h1>;
18+
return <h1>Hello, World!</h1>;
2019
}
2120

2221
export default Greeting;
2322
```
2423

2524
**Rendering a React Component:**
25+
2626
```javascript
27-
import React from 'react';
28-
import ReactDOM from 'react-dom';
29-
import Greeting from './Greeting';
27+
import React from "react";
28+
import ReactDOM from "react-dom";
29+
import Greeting from "./Greeting";
3030

31-
ReactDOM.render(<Greeting />, document.getElementById('root'));
31+
ReactDOM.render(<Greeting />, document.getElementById("root"));
3232
```
3333

3434
**HTML File:**
35+
3536
```html
36-
<!DOCTYPE html>
37+
<!doctype html>
3738
<html lang="en">
38-
<head>
39-
<meta charset="UTF-8">
39+
<head>
40+
<meta charset="UTF-8" />
4041
<title>React Example</title>
4142
<script src="https://unpkg.com/react/umd/react.development.js"></script>
4243
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
4344
<script src="path/to/your/bundle.js" type="text/babel"></script>
44-
</head>
45-
<body>
45+
</head>
46+
<body>
4647
<div id="root"></div>
47-
</body>
48+
</body>
4849
</html>
49-
```
50+
```

courses/MongoDB/intermediate-Level/Data-Validation/Schema-validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
id: lesson-1
2+
id: lesson-3
33
title: "Data Validation in MongoDB"
44
sidebar_label: Data Validation
5-
sidebar_position: 1
5+
sidebar_position: 3
66
description: "Data Validation in MongoDB"
77
tags: [courses,beginner-level,Data Validation,Introduction]
88
---

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ const config = {
204204
},
205205

206206
{
207-
to: "/blog",
208-
html: '<span class="nav-emoji">📰</span> Blog',
207+
to: "/blogs",
208+
html: '<span class="nav-emoji">📰</span> Blogs',
209209
},
210210

211211
{
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
id: largest-element-in-array
3+
title: Largest Element In Array
4+
sidebar_label: Largest-Element-In-Array
5+
tags:
6+
- Arrays
7+
- Data Structure
8+
description: "This tutorial covers the solution to the Largest Element In Array problem from the GeeksforGeeks website, featuring implementations in C++."
9+
---
10+
## Problem Description
11+
Given an array `arr`, the task is to find the largest element in it.
12+
13+
## Examples
14+
15+
**Example 1:**
16+
17+
```
18+
Input: arr= [1, 8, 7, 56, 90]
19+
Output: 90
20+
Explanation: The largest element of given array is 90.
21+
```
22+
23+
**Example 2:**
24+
25+
```
26+
Input: arr = [5, 5, 5, 5]
27+
Output: 5
28+
Explanation: The largest element of given array is 5.
29+
```
30+
31+
## Your Task
32+
33+
You don't need to read input anything. Your task is to complete the function `largest()` which takes the array `arr` and an size of array as `n` as input parameters and returns the largest number.
34+
35+
Expected Time Complexity: O(n)
36+
37+
Expected Auxiliary Space: O(1)
38+
39+
## Constraints
40+
41+
* `1 <= arr.size()<= 10^5`
42+
43+
## Problem Explanation
44+
45+
The task is to traverse the whole array and find the largest element of that array.
46+
47+
## Code Implementation
48+
49+
### C++ Solution
50+
51+
52+
```cpp
53+
class Solution
54+
{
55+
public:
56+
int largest(vector<int> &arr, int n)
57+
{
58+
int maxi = INT_MIN;
59+
for(int i=0; i<n; i++){
60+
maxi = max(arr[i], maxi);
61+
}
62+
return maxi;
63+
}
64+
};
65+
```
66+
67+
```java
68+
public class Solution {
69+
public int largest(int[] arr) {
70+
int maxi = Integer.MIN_VALUE;
71+
for (int i = 0; i < arr.length; i++) {
72+
maxi = Math.max(arr[i], maxi);
73+
}
74+
return maxi;
75+
}
76+
}
77+
78+
```
79+
80+
```python
81+
class Solution:
82+
def largest(self, arr):
83+
maxi = float('-inf')
84+
for i in range(len(arr)):
85+
maxi = max(arr[i], maxi)
86+
return maxi
87+
88+
```
89+
90+
```javascript
91+
class Solution {
92+
largest(arr) {
93+
let maxi = -Infinity;
94+
for (let i = 0; i < arr.length; i++) {
95+
maxi = Math.max(arr[i], maxi);
96+
}
97+
return maxi;
98+
}
99+
}
100+
101+
```
102+
103+
```typescript
104+
class Solution {
105+
largest(arr: number[]) {
106+
let maxi = -Infinity;
107+
for (let i = 0; i < arr.length; i++) {
108+
maxi = Math.max(arr[i], maxi);
109+
}
110+
return maxi;
111+
}
112+
}
113+
114+
``
115+
116+
## Time Complexity
117+
118+
* The time complexity is $$O(n)$$ where n is the length of the input array. This is because we are iterating through the array once to find the maximum element.
119+
120+
## Space Complexity
121+
122+
* The auxiliary space complexity is $O(1)$ which means the space required does not change with the size of the input array. This is because we are only using a fixed amount of space to store the maximum element and the index.

0 commit comments

Comments
 (0)