1Linear search?
Starts at first item and checks each item one by one:
-Doesnt need to be ordered/sorted
-Can be efficient in small data sets but NOT in large data sets
2Example of python inplementation
3Binary search?
Find an item in SORTED data set via divide and conquer:
Need sorted list and is efficient for large data sets
Discards HALF of the data set per time
4Actual steps?(lets say find y)
1)Front and rear pointers point to first and last item
2)Calculate midpoint by n//2, if its y output it BUT:
2.5A) IF mid point is larger then y, rear pointer becomes n-1 and discard right side.
2.5B) IF midpoint is smaller then y, front pointer becomes n+1 discard left side.
3)REPEAT UNTIL MIDPOINT EQUALS AND IS Y
5Implementation of binary search in python:
6Bubble sort
Compares an item to next and swaps if not in order,repeat with next pairs until reach end which is called a
pass.-Repeat this whole process again until all items are ordered
-"Bubbles" the largest/smallest unsorted item to the top per pass

7Implimentation of bubble sort in python:
8Insertion sort?
Inserts an item into correct spot at one time each
Starts at the 2nd item(then 3 etc) and compares items to the left and sees if they should swap or not

9Implimentation of insertion sort in python:
10Merge sort ?
Divide and conquer: Splits items all into individual lists then compares,sorts and combines adjacent lists. Repeat for the other lists.
Then compares,sorts,combines adjacent 2 item lists. Repeat for others
Do this until you have one sorted list

11Implimentation of merge sort

12Quick sort?
1)Uses a pivot(1st item) in which items smaller are placed to the left side sublist and items larger on right sublist. Pivot is then sorted.
2)Repeat same steps for the left and right sublists.
3)Do this until all items become pivots in which then it becomes sorted
13Implimentation of quick sort: