Please enable JavaScript.
Coggle requires JavaScript to display documents.
Searching Algorithms (Arrays (a data structure that is made up of a number…
Searching Algorithms
Arrays
a data structure that is made up of a number of variables or data items that all have the same data type and are accessed by the same name.
-
Access to the individual items in the array is made by the use of an index or subscript beside the name of the array age[1].
Sorting Algorithms
The Bubble sort
Compare the first two elements, swap if they are not sorted, continue this process until you reach the end of the array by comparing each element with the next element. After the first pass the largest element is positioned at the end of the array. Carry on with further passes by starting at the beginning of the array until all elements are sorted,
-
Insertion Sort
Insertion sort works by comparing the first two elements and first sorting them in order, then insert the next element in its place in the already sorted sub set of the data and so on until the data is sorted.
-
The Selection sort
This sort works by starting at the beginning of the array, comparing the first element with the other elements in the array. The smallest element is placed in position 0, and the sort then begins again at position 1. This continues until each position except the last position has been the starting point for a new loop.
-
Recursion
-
Involves decomposing the original problem into a series of simpler sub problems that are similar to the original problem.
-
The Factorial
The factorial (!) of a positive integer number is the product of all positive integers less than or equal to the number.
-
-
Linear search
There are several problems that can be solved by searching algorithms: -Locating an element in an array, locating maximum or minimum values from data.
-
Binary Search
When the records you are searching through are sorted in order, you can perform a more efficient search than the sequential search to find a value. This search is called a binary search.
-