Uses of algorithms
Algorithms are used in a wide range of applications, from simple tasks like sorting numbers to complex processes like machine learning and neural networks.
Sorting
- Algorithms are commonly used to sort data in specific orders based on specific criteria, such as value, alphabetic order, data points, etc.
- Some notable sorting algorithms include bubble sort, selection sort and insertion sort.
Searching
- Algorithms are commonly used to search for specific elements in large datasets and/or lists of data.
- Most commonly used searching algorithms are linear search and binary search.
Searching for a specific student in a large list of students of a school is an example of when a searching algorithm may be used to speed up the search process.
Filtering and counting
- Algorithms may be used to filter out specific data in large datasets based on given criteria, and/or to count how many entries or elements satisfy the given criteria.
- Some searching algorithms can also serve as filtering and counting algorithms, such as linear search.
- Imagine a scenario where a school wants to print the names of all students who have a perfect GPA. They could use a filtering algorithm that will select only students with a perfect GPA in a list of all school students.
- Alternatively, if they only want the number of students who have a perfect GPA, they could use a counting algorithm.