Please enable JavaScript.
Coggle requires JavaScript to display documents.
SORTING AND SEARCHING - Coggle Diagram
SORTING AND SEARCHING
SEARCHING
- the process of location given value in a list of values
Linear
- checks through, each element, from beginning to end until value is found
Binary
- Starts at center, goes halfway forward or halfway backward depending if value is smaller/larger, until value is reached
LINER VS BINARY
Linear
- value need not to be sorted.
- start at the beginning of a list of values, and checks 1 by 1 in order for the result.
- efficient for smaller array
- requires sequential access to the data.
Binary
- values must be in sorted order.
- start in the middle of a sorted array, and determines which side (if any) the value you are looking for is on.
- efficient for larges array.
- requires random access to the data.
SORTING
- the prcess of arranging a list of element in a perticular order ascending or descending
Selection Sort
- used to arrange a list of element in a particular oerder.
- ascending and descending
Insertion Sort
- insertion sort Algorithm arranges a list of elements in a particular order.
Merge Sort
- divide and conquer algorithm.
Bubble Sort
- compare 2 element at time and swap if the second element is large than first element
Quick Sort
- divide and conquer algorithm.