2.6 Standard Algorithms
In computational thinking, standard algorithms are fundamental methods used to solve common problems. Understanding these algorithms helps to develop problem- solving skills and provides a foundation for more complex programming tasks. Following are some standard algorithms:
Sorting Algorithms
These algorithms are used to arrange data in a specific order (ascending or descending)
Bubble Sort: Repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
Selection Sort: Divides the list into a sorted and an unsorted part, and repeatedly selects the smallest (or largest) element from the unsorted part to move to the sorted part.
Merge Sort: Divides the list into halves, recursively sorts each half, and then merges the sorted halves.
Insertion Sort: An in- place sorting algorithm that builds the final sorted array one element at a time, shifting elements greater than the current element to the right.