Computer Science, asked by dipshikhachatte4161, 7 months ago

If ar is an array, which element will be referenced using ar(7)

Answers

Answered by cherry975
5

Answer:

Eighth element

hope this will helps you :-D

Answered by nancychaterjeestar29
1

Answer:

def partition(array, low, high):

 pivot = array[high]

 i = low - 1

 for j in range(low, high):

   if array[j] <= pivot:

     i = i + 1

     (array[i], array[j]) = (array[j], array[i])

 (array[i + 1], array[high]) = (array[high], array[i + 1])

 return i + 1

def quickSort(array, low, high):

 if low < high

   pi = partition(array, low, high)

   quickSort(array, low, pi - 1)

   quickSort(array, pi + 1, high)

data = [8, 7, 2, 1, 0, 9, 6]

print("Unsorted Array")

print(data)

size = len(data)

quickSort(data, 0, size - 1)

print('Sorted Array in Ascending Order:')

print(data)

#SPJ2

Similar questions