List Manipulation
List Manipulation
#Bubble sort
L = [3, 2, 1]
bsort(L, len(L))
print L
Deletion
L = [1, 2, 3, 4, 5]
print L
delete(L, len(L), 3)
print L
#Insertion
l.append(0)
for i in range(n, pos, -1):
l[i] = l[i-1]
l[pos] = data
L = [1, 2, 4, 5]
print L
insert(L, len(L), 3)
print L
#Selsort
L = [3, 2, 1]
SelSort(L, len(L))
print L
#Binary search
L = [10,9,8,7,6,5,4,3,2,1]