diff --git a/docs/dsa/algorithms/searching_algorithm.md b/docs/dsa/algorithms/searching_algorithm.md index ed0dbb6bc..a26f654e6 100644 --- a/docs/dsa/algorithms/searching_algorithm.md +++ b/docs/dsa/algorithms/searching_algorithm.md @@ -4,14 +4,9 @@ title: Searching in Data Structures and Algorithms sidebar_label: Searching Algorithm sidebar_position: 1 description: "" -tags: - [dsa,data-algorithms , searching - ] +tags: [dsa, data-algorithms, searching] --- - - - 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. ![alt text](image.png) @@ -73,8 +68,8 @@ Remember to provide appropriate input and handle edge cases when implementing th ## Additional Questions 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: - - **Input:** Array: [5, 2, 9, 7, 3], Target: 9 - - **Output:** Index: 2 + - **Input:** Array: [5, 2, 9, 7, 3], Target: 9 + - **Output:** Index: 2 ```cpp #include @@ -100,8 +95,8 @@ int main() { ``` 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: - - **Input:** Array: [1, 3, 5, 7, 9], Target: 5 - - **Output:** Index: 2 + - **Input:** Array: [1, 3, 5, 7, 9], Target: 5 + - **Output:** Index: 2 ```java public class BinarySearch { @@ -131,8 +126,8 @@ public class BinarySearch { ``` 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: - - **Input:** Dictionary: ```{"apple": 1, "banana": 2, "orange": 3}```, Key: "banana" - - **Output:** Value: 2 + - **Input:** Dictionary: `{"apple": 1, "banana": 2, "orange": 3}`, Key: "banana" + - **Output:** Value: 2 ```python hash_map = { @@ -148,7 +143,6 @@ print("Value:", value) Remember to provide appropriate input and handle edge cases when implementing these algorithms to ensure correct results. - 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. 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 Overall, understanding and implementing different searching algorithms is crucial for efficient data retrieval and manipulation in various programming scenarios. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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. 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. diff --git a/src/components/Lesson/index.tsx b/src/components/Lesson/index.tsx index bae4f4b13..b51d6eb59 100644 --- a/src/components/Lesson/index.tsx +++ b/src/components/Lesson/index.tsx @@ -22,7 +22,7 @@ const Lesson: React.FC = ({ title, tags, description }) => {

{description}

{/* Description or content of the lesson */}
{/* Container for tags */} {tags.map((tag, index) => ( - {tag} + {tag} )) }
@@ -30,4 +30,4 @@ const Lesson: React.FC = ({ title, tags, description }) => { ); }; -export default Lesson; \ No newline at end of file +export default Lesson; diff --git a/src/dsa/searching-algorithms/LinearSearchVisualizer/index.tsx b/src/dsa/searching-algorithms/LinearSearchVisualizer/index.tsx index 799ae05f4..f9ecaed61 100644 --- a/src/dsa/searching-algorithms/LinearSearchVisualizer/index.tsx +++ b/src/dsa/searching-algorithms/LinearSearchVisualizer/index.tsx @@ -85,4 +85,4 @@ const LinearSearchVisualizer: React.FC = () => { ); }; -export default LinearSearchVisualizer; \ No newline at end of file +export default LinearSearchVisualizer; diff --git a/src/pages/about/index.tsx b/src/pages/about/index.tsx index e249d97e3..3c099a531 100644 --- a/src/pages/about/index.tsx +++ b/src/pages/about/index.tsx @@ -23,7 +23,7 @@ export default function About(): React.JSX.Element { src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js" /> - + );