Consider the given Python program.
The output of the program is __________ . (Answer in integer)
python
Programming, Data Structures and Algorithmsbasic sorting algorithms: selection sort, bubble sort and insertion sortNAT2 marksMedium
1def fun(L, i=0):
2 if i >= len(L)-1:
3 return 0
4 if L[i] > L[i+1]:
5 L[i+1], L[i] = L[i], L[i+1]
6 return 1+fun(L, i+1)
7 else:
8 return fun(L, i+1)
9data = [5, 3, 4, 1, 2]
10count = 0
11for _ in range(len(data)):
12 count += fun(data)
13print(count)
14A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.