SORTING
It refers to arranging element in a specific order ascending or descending
BUBBLE SORTING
The basic idea is to compare 2 adjoining values and exchange ,then if they are not in proper order.In every pass the heaviest element settles at its appropriate position in the bottom.
BUBBLE SORT
alist=[15,6,13,22,35,2]
print("original list is'' : alist)
n=len(alist)
for i in range (n):
for j in range (0,n-j,-1):
if alist (i)>alist (j+1):
alist=(j+1):
print("list after sorting:,alist)
INSERTION SORT
lst=[15,14,2,3,4,5,6,77,88,90]
print("original list is:"lst)
for i in range (1,len(lst)):
temp=lst[i]
j=i-1
while j>0 and temp<lst[j]:
lst[j+1]=lst[j]
j=j-1
else:
lst[j+1]=temp
print("list after sort is:",lst)
how to download assassins creed ragnarokkkkkk
ReplyDeletebaago loogo
ReplyDelete10th class me fial the hum
ReplyDeletebihar ka rehene wale h humm
ReplyDeletekuch samaj me nahi aata
ReplyDeleterickshaw chalene me mzao aata hai
ReplyDeletehume paan pasand h
ReplyDeletelog hume bihari kehete hai
ReplyDeleteplaes follow karo hume on isntagarm @xxxxx
ReplyDeleteaur batao kaise ho tum hum toh mote hai
ReplyDeletehume 12 ka tbale nahi aate hai prr hum bihari hai ......proud to be a bihari.....aap kaha rehete ho hum toh bihar me rehete hai .....kriypa batae .....hum toh bihar me rehete hai .....bihari babu......... :)
ReplyDeletebye kal baat karte hai hum aapse from bihar by bihari babu latchay.......
ReplyDelete