c. algorithm race
A coding challenge
Objective
Demonstrate your understanding of standard algorithms by implementing a sorting algorithm and a searching algorithm entirely from scratch. You must not use any built-in language sorting or searching methods (such as .sort() or .index()).Requirements
Hardcode the following unsorted array (or list) of integers into your program:
[64, 34, 25, 12, 22, 11, 90, 45, 73, 5]Implement a standard sorting algorithm (e.g., Bubble Sort or Insertion Sort) to sort the array into ascending order.
Output the sorted array to the console.
Implement a standard search algorithm (e.g., Binary Search) to find the index position of the target value, 45, within your newly sorted array.
Output the index position of the target value, or a suitable message if the value is not found in the array.
Stretch Goal
Add a counter variable to your sorting algorithm to track and output the total number of comparisons made during the sorting process. Implement an optimisation (such as an early exit flag in a Bubble Sort) to reduce this number.Last modified: September 6th, 2026
