Created
April 22, 2013 17:13
-
-
Save emreyh/5436819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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