1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
what is an algorithm?
a list of step-by-step instructions that help solve a problem
what is a searching algorithm?
an algorithm used to locate specific items in a collection of data
how do you do linear search?
you identify a search term, then look at the first item in the list and compare it to the search term. If it is the same, you have found the search term, otherwise move onto the next item and do the same thing.
how do you do bubble sort?
you compare two items that are next to each other to see if they are in the wrong order (one on the left is greater than one on the right). You should keep going through the list of data until all the data is sorted into order.
how do you do insertion sort?
An insertion sort compares values in turn, starting with the second value in the list. If this value is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. The sort process then starts again with the next value. This continues until the end of the list is reached.
how do you do quick sort?
First, choose the pivot, then rearrange the items in the list so that items less or equal to the pivot are on the left and items that are greater are on the right. Repeat until the list is sorted.
how do you do merge sort?
the algorithm starts by splitting a list of items into two halves.
You then split them in half again until each sublist has only one item.
You can then merge them by comparing the first list item at each merge and putting them in order.
Continue to compare the sublists until the data is in order
how do you do binary?
First, take the number of items in the list and add 1, then divide by 2 to find the middle number.
Then, if the item you are looking for is greater than the the midpoint, take all items on the right, if not take the items on the left.
do the same thing, and repeat until you find the search term
what are the different sorting algorithms?
insertion
merge
quick
bubble