data structures using (fcompare and since swapping is done observe that after the end of the second passthe second largest element is placed at the second highest index of the array all the other elements are still unsorted pass (acompare and since no swapping is done (bcompare and since no swapping is done (ccompare and since swapping is done (dcompare and since swapping is done (ecompare and since no swapping is done observe that after the end of the third passthe third largest element is placed at the third highest index of the array all the other elements are still unsorted pass (acompare and since no swapping is done (bcompare and since swapping is done (ccompare and since swapping is done (dcompare and since no swapping is done observe that after the end of the fourth passthe fourth largest element is placed at the fourth highest index of the array all the other elements are still unsorted pass (acompare and since swapping is done (bcompare and since swapping is done (ccompare and since no swapping is done observe that after the end of the fifth passthe fifth largest element is placed at the fifth highest index of the array all the other elements are still unsorted pass (acompare and since swapping is done (bcompare and since no swapping is done observe that after the end of the sixth passthe sixth largest element is placed at the sixth largest index of the array all the other elements are still unsorted pass (acompare and since no swapping is done observe that the entire list is sorted now bubble_sort(anstep repeat step for to - step repeat for to step if [ja[ swap [jand [ + [end of inner loop[end of outer loopstep exit figure algorithm for bubble sort figure shows the algorithm for bubble sort in this algorithmthe outer loop is for the total number of passes which is - the inner loop will be executed for every pass howeverthe frequency of the inner loop will decrease with every pass because after every passone element will be in its correct position thereforefor every passthe inner loop will be executed - timeswhere is the number of elements in the array and is the count of the pass