Skip to content

Instantly share code, notes, and snippets.

@emreyh
Created April 22, 2013 17:13
Show Gist options
  • Save emreyh/5436819 to your computer and use it in GitHub Desktop.
Save emreyh/5436819 to your computer and use it in GitHub Desktop.
def listeYarilama(alist,atlama):
altliste=[]
for i in range (0,len(alist),atlama+1):
altliste.append(alist[i])
return altliste
def listeYarilama_enbuyugubul(alist,atlama):
temp=alist[0]
for i in range (0,len(alist),atlama+1):
if alist[i]>temp:
temp=alist[i]
return temp
def altliste_insertionSort(alist,atlama):
altListe=listeYarilama(alist,atlama)
for baslangic in range(1,len(altListe)):
kayanDeger = altListe[baslangic]
pozisyon = baslangic
while pozisyon > 0 and altListe[pozisyon-1] > kayanDeger:
altListe[pozisyon] = altListe[pozisyon-1]
pozisyon -= 1
altListe[pozisyon] = kayanDeger
return altListe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment