Skip to content

Commit 725cb66

Browse files
committed
Merge branch 'dev-3' of https://github.com/CodeHarborHub/codeharborhub into dev-3
2 parents 70d2af2 + cfad89f commit 725cb66

File tree

4 files changed

+11
-48
lines changed

4 files changed

+11
-48
lines changed

docs/dsa/algorithms/searching_algorithm.md

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ title: Searching in Data Structures and Algorithms
44
sidebar_label: Searching Algorithm
55
sidebar_position: 1
66
description: ""
7-
tags:
8-
[dsa,data-algorithms , searching
9-
]
7+
tags: [dsa, data-algorithms, searching]
108
---
119

12-
13-
14-
1510
Searching is a fundamental operation in computer science and is widely used in various applications. In the context of Data Structures and Algorithms (DSA), searching refers to the process of finding a specific element within a collection of data.
1611

1712
![alt text](image.png)
@@ -73,8 +68,8 @@ Remember to provide appropriate input and handle edge cases when implementing th
7368
## Additional Questions
7469

7570
1. **Question:** Implement a linear search algorithm in C++ to find the index of a target element in an array. Provide the input and output for the following scenario:
76-
- **Input:** Array: [5, 2, 9, 7, 3], Target: 9
77-
- **Output:** Index: 2
71+
- **Input:** Array: [5, 2, 9, 7, 3], Target: 9
72+
- **Output:** Index: 2
7873

7974
```cpp
8075
#include <iostream>
@@ -100,8 +95,8 @@ int main() {
10095
```
10196
10297
2. **Question:** Write a binary search algorithm in Java to find the index of a target element in a sorted array. Provide the input and output for the following scenario:
103-
- **Input:** Array: [1, 3, 5, 7, 9], Target: 5
104-
- **Output:** Index: 2
98+
- **Input:** Array: [1, 3, 5, 7, 9], Target: 5
99+
- **Output:** Index: 2
105100
106101
```java
107102
public class BinarySearch {
@@ -131,8 +126,8 @@ public class BinarySearch {
131126
```
132127

133128
3. **Question:** Implement a hash-based search algorithm in Python to retrieve the value associated with a given key in a dictionary. Provide the input and output for the following scenario:
134-
- **Input:** Dictionary: ```{"apple": 1, "banana": 2, "orange": 3}```, Key: "banana"
135-
- **Output:** Value: 2
129+
- **Input:** Dictionary: `{"apple": 1, "banana": 2, "orange": 3}`, Key: "banana"
130+
- **Output:** Value: 2
136131

137132
```python
138133
hash_map = {
@@ -148,7 +143,6 @@ print("Value:", value)
148143

149144
Remember to provide appropriate input and handle edge cases when implementing these algorithms to ensure correct results.
150145

151-
152146
In conclusion, searching is a fundamental operation in computer science and is widely used in various applications. In the context of Data Structures and Algorithms (DSA), there are several types of searching algorithms, including linear search, binary search, and hash-based search. Each algorithm has its own characteristics and is suitable for different scenarios.
153147

154148
Linear search is a simple algorithm that sequentially checks each element in a collection until the target element is found or the end of the collection is reached. It is commonly used for small collections or unsorted data.
@@ -161,37 +155,6 @@ When implementing these algorithms, it is important to provide appropriate input
161155

162156
Overall, understanding and implementing different searching algorithms is crucial for efficient data retrieval and manipulation in various programming scenarios.
163157

164-
165-
166-
167-
168-
169-
170-
171-
172-
173-
174-
175-
176-
177-
178-
179-
180-
181-
182-
183-
184-
185-
186-
187-
188-
189-
190-
191-
192-
193-
194-
195158
Searching is a fundamental operation in computer science and is widely used in various applications. In the context of Data Structures and Algorithms (DSA), searching refers to the process of finding a specific element within a collection of data.
196159

197160
There are several types of searching algorithms commonly used in DSA, including linear search, binary search, hash-based search, and tree-based search. Each algorithm has its own characteristics and is suitable for different scenarios.

src/components/Lesson/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ const Lesson: React.FC<LessonProps> = ({ title, tags, description }) => {
2222
<p className="lesson-description">{description}</p> {/* Description or content of the lesson */}
2323
<div className="lesson-tags"> {/* Container for tags */}
2424
{tags.map((tag, index) => (
25-
<span key={index} className="lesson-tag">{tag}</span>
25+
<span key={index} className="lesson-tag">{tag}</span>
2626
))
2727
}
2828
</div>
2929
</div>
3030
);
3131
};
3232

33-
export default Lesson;
33+
export default Lesson;

src/dsa/searching-algorithms/LinearSearchVisualizer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ const LinearSearchVisualizer: React.FC = () => {
8585
);
8686
};
8787

88-
export default LinearSearchVisualizer;
88+
export default LinearSearchVisualizer;

src/pages/about/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function About(): React.JSX.Element {
2323
src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"
2424
/>
2525
<meta name="google-adsense-account" content="ca-pub-5832817025080991" />
26-
</Head>
26+
</Head>
2727
<AboutUsSection />
2828
</Layout>
2929
);

0 commit comments

Comments
 (0)