Empathy of the public
def bubbleSort(array):
n = len(array)
for i in range(n):
for j in range(0, n-1):
if array[j] > array[j+1]:
array[j], array[j+1] = array[j+1], array[j]
array = [200 ,190, 1200, 1, 2, 4, 55, 1000, 6, 800]
bubbleSort(array)
print(array)
Bubblesort O(n²)
repulsion: 200x,
edgeLength: 5
The function 200x is bounded above by x². This means that when x x tends to infinity the value of 200x can be neglected with respect to x²
Case study
Artist Ranking 1000 from the entire list of artists on Artfacts. Artist = [1]. Public = [200 ,190, 1200, 1, 2, 4, 55, 1000, 6, 800]. Events [10].
Sorting Algorithm
The algorithm sorts or rearranges a list a of n values, in this case n numbered terms from 0 to n-1; It consists of two nested loops, one with index i, which gives a size smaller than the bubble path in reverse from 2 to n, and a second loop with index j, with a path from 0 to n-i, for each iteration of the first loop, which indicates the location of the bubble.