Lab 08
Lab 08
Input:
[92, 82, 21, 16, 18, 95]
Output:
[16, 18, 21, 82, 92, 95]
Number of comparisons = 14
Number of exchanges = 9
Binary Search: Implementation
Input:
[92, 82, 21, 16, 18, 95, 25, 10]
92
Output:
[10, 16, 18, 21, 25, 82, 92, 95]
92 found at index 6 in the sorted array
Number of comparisons = 2
Binary Search: Example 2
Input:
[92, 82, 21, 16, 18, 95, 25, 10]
30
Output:
[10, 16, 18, 21, 25, 82, 92, 95]
30 not found in the array.
Number of comparisons = 3
Home Tasks
2. https://en.wikipedia.org/wiki/Bubble_sort
3. https://en.wikipedia.org/wiki/Selection_sort
4. https://en.wikipedia.org/wiki/Insertion_sort
5. https://en.wikipedia.org/wiki/Sorting_algorithm
6. https://en.wikipedia.org/wiki/Binary_search_algorithm