Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 6.84 KB

File metadata and controls

69 lines (45 loc) · 6.84 KB

1️⃣ Sorting and Searching 🔎

✅ Implementation of simple sorting and searching algorithms using C➕➕

1️⃣ Sorting algorithms arrange a collection of items (like numbers or words) in a specific order, usually in ascending or descending order. The algortihms used for sorting the programs are Bubble sort, Insertion sort, Selection sort and Linked List.

🔎 Searching algorithms find the position of a specific value within a collection of items. The algorithms used for searching are Linear search and Binary search.

📚 Book_Info.cpp -> Sorting and Searching of Book Information

👨🏾‍💻 The program contains an implementation of simple sorting and searching algorithms, concepts in data structure and algorithm (DSA). For sorting purposes the program used bubble sort, selection sort and insertion sort and for searching linear and binary search were used. Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. This process is repeated until no swaps are needed, indicating that the list is sorted. Selection sort is a simple sorting algorithm that divides the input list into two parts: a sorted part at the beginning and an unsorted part at the end. Insertion sort is a simple sorting algorithm that works similar to how you might sort a hand of playing cards. It builds a sorted array one item at a time. Linear search, also known as sequential search, is a straightforward searching algorithm that examines each element in a list or array sequentially to find a target element. Binary search is a highly efficient searching algorithm that leverages the fact that the input list or array must be sorted. It works by repeatedly dividing the search interval in half.

🌱 Here is the general overview of the program:-
1️⃣ When user presses "1", the program asks to set book information. Which is inserting Author name, Book title and Book Id. The program accepts only a number as Book ISBN. After the user inserts book information. They can perform the following operations:-
2️⃣ View the book information inserted by pressing "2",
3️⃣ Perform:- sort by Book Id by pressing "3" (using bubble sort)
4️⃣ Sort by Book title by pressing "4" (using selection sort), sort by Author name by pressing "5" (using insertion sort)
5️⃣ Search by book Id by pressing "6" (linear searching) and search by author name (using binary searching).
6️⃣ Users can also press "8" know the team of the project and "0" to exit the program.

💢 The main purpose of using these searching algorithms is to have organized data input and that of searching is accessing data in need without having to go through the entire data.
⏳ The time it takes to sort a given amount of data varies from one sorting algorithm to another. Also the time it takes to access a data by searching varies from one searching algorithm to another. The time it take to sort or search data is called Time Complexity. All the concepts on this program are well taught on the course Data Structure and Algorithms (DSA).

🖼️ You can find the output of the program on the image below 💁🏾‍♂️

Book information prototype

🎬 Movie_Info.cpp -> Sorting of Movie Information using Linked List

🟠 A linked list is a linear data structure that consists of a sequence of nodes, each containing two fields:
📁 Data: The actual data stored in the node and
⏭️ Next: A pointer (link) to the next node in the sequence.
🚮 This structure allows for efficient insertion and deletion ❌ of elements at any position in the list, but accessing a specific element requires traversing the list from the beginning. 🚮 In the program, a user inputs information about movies and can use linked list to sort the information inserted.

🌱 Here is the general overview of the program:-

1️⃣ By pressing "1", "2" and "3", user can add movie information at the start, at the end or at a specific place respectively.
2️⃣ User also can delete movie information from the start, from the end or at a specific position by pressing "4", "5" and "6" respectively.
3️⃣ Users can also press "7" to know team members of the project and "0" to exit the program.
💡 Linked list is also a fundamental concept in the course Data Structre and Algorithms (DSA).

🖼️ You can find the output of the program on the image below 💁🏾‍♂️

Movie information prototype

🎓 Student_Info.cpp -> Sorting and Searching of Student information

🟠 The program contains an implementation of simple sorting and searching algorithms, concepts in data structure and algorithm (DSA). For sorting Bubble sort, Insertion sort and Selection sort were implmented and for searching Linear and Binary search were used.

🌱 Here is the general overview of the program:-

1️⃣ When user presses "1", the program asks to enter student information after asking the amount of data recieved. Which is inserting Student Id, Student Name and Age. The program accepts only a number as Student Id. After the user inserts Student information. They can perform the following operations:-
2️⃣ View the data inserted by pressing "2"
3️⃣ Perform:- sort by Student Id by pressing "3" (using bubble sort)
4️⃣ Sort by Student Name by pressing "4" (using selection sort)
5️⃣ Sort by Age by pressing "5" (using insertion sort), search by Age by pressing "6" (linear searching) and search by Student name (using binary searching)
6️⃣ User can also delete the data of Student after inserting Student Id by pressing "8"
7️⃣ Users can press "9" to know team members of the project and "0" to exit the program.
💢 The main purpose of using these searching algorithms is to have organized data input and that of searching is accessing data in need without having to go through the entire data.
⏳ The time it takes to sort a given amount of data varies from one sorting algorithm to another. Also the time it takes to access a data by searching varies from one searching algorithm to another. The time it take to sort or search data is called Time Complexity. All the concepts on this program are well taught on the course Data Structure and Algorithms (DSA).

N.B: This project elaborates on the use of Simple sorting and searching algorithms after sorting and searching of book information program 👨🏾‍💻

🖼️ You can find the output of the program on the image below 💁🏾‍♂️

Student information prototype