<prompt> Kuandika algorithm ya kuandaa zilizotolewa safu ya integer.3, 7, 1, 0, 4, 9, 8  <response>: Here is an example of an algorithm to sort the given array in ascending order using the Bubble Sort method:1. Take the input array and determine its length in this case, 7.2. Create a loop to iterate through the array from the first element to the second last element.3. For each iteration, create another loop to iterate from the first element to the last unsorted element in the array.4. Compare the current element with the next element, if the current element is greater than the next element, swap them.5. Repeat steps 3-4 until all elements have been sorted in ascending order.6. Return the sorted array. Here is the algorithm implemented in code:def bubbleSortarr: n lenarr for i in rangen: for j in range0, n-i-1: if arrj arrj1: arrj, arrj1 arrj1, arrj return arrarr 3, 7, 1, 0, 4, 9, 8sorted_array bubbleSortarrprintsorted_arrayThe output will be: 0, 1, 3, 4, 7, 8, 9 