| | |
| Stránka: 1 z 1
| [ Príspevkov: 6 ] | |
Autor | Správa |
---|
Registrovaný: 18.07.07 Prihlásený: 20.02.10 Príspevky: 53 Témy: 9 Bydlisko: Trenčín - S... | Napísal shcl: 19.03.2008 21:54 | |
|
Zdravim osadenstvo fora. Maam taky maly problem, dostal som zadanie v ktorom mam porovnat dva triediace algorytmi. Su to Shakesort a Strandsort prvy dokazem bezproblemov napisat v Ccku ale nejako som nepochopil princip strandsortu a tak ma napadlo ci by to niekto z vas nevedel napisat alebo ci sa tym uz niekto nezapodieval predomnou.
http://en.wikipedia.org/wiki/Strand_sort
tu je nieco o tom algorytme aj nejake pseudokody ak by vam to pomohlo, ja by som to potreboval napisat v cistom Ccku.
_________________ MB: Gigabyte GA M57 SLI S4 | P: Athlon 64 X2 5200+(Winsdor) | RAM: ADATA Extreme edition Vitesta 2x1024MB 800MHz | G: Saphire AMD Radeon HD 2600XT 256Mb DDR4 | HDD: Seagate BArracuda 160GB 8MB Cache | Z: Fortron Blue Storm 400W
"92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature" |
|
Registrovaný: 18.07.07 Prihlásený: 20.02.10 Príspevky: 53 Témy: 9 Bydlisko: Trenčín - S... | Napísal autor témy shcl: 21.03.2008 17:51 | |
|
vobec nic???
_________________ MB: Gigabyte GA M57 SLI S4 | P: Athlon 64 X2 5200+(Winsdor) | RAM: ADATA Extreme edition Vitesta 2x1024MB 800MHz | G: Saphire AMD Radeon HD 2600XT 256Mb DDR4 | HDD: Seagate BArracuda 160GB 8MB Cache | Z: Fortron Blue Storm 400W
"92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature" |
|
Registrovaný: 18.07.07 Prihlásený: 20.02.10 Príspevky: 53 Témy: 9 Bydlisko: Trenčín - S... | Napísal autor témy shcl: 27.03.2008 10:06 | |
|
Nevedel by to neikto aspom podla tohto pseudocodu?? ja si s tym fakt neviem dat rady. PROOOSIIIMMM.
Kód: procedure strandSort( A : list of sortable items ) defined as: while length( A ) > 0 clear sublist sublist[ 0 ] := A[ 0 ] remove A[ 0 ] for each i in 0 to length( A ) do: if A[ i ] > sublist[ last ] then append A[ i ] to sublist remove A[ i ] end if end for merge sublist into results end while return results end procedure
_________________ MB: Gigabyte GA M57 SLI S4 | P: Athlon 64 X2 5200+(Winsdor) | RAM: ADATA Extreme edition Vitesta 2x1024MB 800MHz | G: Saphire AMD Radeon HD 2600XT 256Mb DDR4 | HDD: Seagate BArracuda 160GB 8MB Cache | Z: Fortron Blue Storm 400W
"92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature" |
|
Registrovaný: 16.05.07 Prihlásený: 01.08.17 Príspevky: 837 Témy: 6 | Napísal juho: 27.03.2008 21:32 | |
|
Kód: strand(int **a){ int **sublist; while(len(pole)>0){ free(sublist); sublist[0]=a[0]; free(a[0]) for(i=0;i<=len(a);i++) if(a[i]>sublist[last]){ ++*sublist=a[i];free(a[i]);} } }
a vzdavam sa ....
len() je ako memset alebo sizeof
free ako znic prvok a last je hadam posledne miesto v poli.
_________________ getch();?{readkey;?} na konci? !A naco! Riesenie je (Alt+F5)
99% pochopí a shaggy je druhá kategória |
|
Registrovaný: 18.07.07 Prihlásený: 20.02.10 Príspevky: 53 Témy: 9 Bydlisko: Trenčín - S... | Napísal autor témy shcl: 27.03.2008 21:38 | |
|
noo trochu si mi pomohol ale moc nie aj tak to nei je vyriesene ja som z toho uz jelen, taku drbnutu ulohu uz som davnio nemal.. ale dik za snahu, aj to sa ceni.
NO co ostatny? Uz nikto nema gule na to pustit sa do toho?
_________________ MB: Gigabyte GA M57 SLI S4 | P: Athlon 64 X2 5200+(Winsdor) | RAM: ADATA Extreme edition Vitesta 2x1024MB 800MHz | G: Saphire AMD Radeon HD 2600XT 256Mb DDR4 | HDD: Seagate BArracuda 160GB 8MB Cache | Z: Fortron Blue Storm 400W
"92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature" |
|
Registrovaný: 16.05.07 Prihlásený: 01.08.17 Príspevky: 837 Témy: 6 | Napísal juho: 27.03.2008 21:52 | |
|
az fakt nevies tak Kód: http://people.tuke.sk/igor.podlubny/C/Kap11.htm merge-sort vyzera dost podobne mozno ze heap-sort.
|
|
| Stránka: 1 z 1
| [ Príspevkov: 6 ] | |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|