Autor Beitrag
amazing
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 22.05.08 16:58 
Hallo, im Informatikunterricht, müssen wir ein Sortierverfahren schreiben und danach ein Referat darüber halten.
In einem Memofeld sollen ungeordnete Zahlen sein, per Buttonklick, soll jeweils der nächste Schritt im Memofeld angezeigt werden, also Zahlen verglichen werden, wenn ich das richtig verstanden habe. Als das Verfahren erklärt wurde, war ich leider krank und stehe deshalb ziemlich auf dem Schlauch, im Internet hab ich schon nach 'Bubblesort' gesucht, hab das aber nicht wirklich verstanden.

Ich hoffe ihr könnt mir helfen
huuuuuh
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Do 22.05.08 17:09 
hallo, am einfachsten geht das, indem du jede zeile des memos in eine listbox kopierts, diese anschließend auf sorted:=true stellts, und dann jede zeile ins memofeld kopierst
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Do 22.05.08 17:20 
Hi,

@huuuuuh: Wenn du seinen Post gelesen hättest, wäre dir aufgefallen, dass ein selbstimplementierter Algorithmus gesucht ist. Nebenher: Da braucht man ncihts zu kopieren, einfach Memo1.Lines.Sort;

@amazing: Such mal nach Quicksort, das ist glaube ich eher gemeint. Ihr sollt aber glaube ich selbst etwas ausdenken, insofern würde ich dir raten, es einfach mal ohne Vorlage zu probieren oder einen Schulkammeraden zu fragen.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 22.05.08 17:27 
Na toll. Bubblesort ist zu kompliziert, also nimmt man Quicksort, ja? :lol:

Bubblesort ist mit das einfachste Verfahren - wo hakt es denn?

_________________
We are, we were and will not be.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Do 22.05.08 18:00 
user profile iconGausi hat folgendes geschrieben:
Na toll. Bubblesort ist zu kompliziert, also nimmt man Quicksort, ja? :lol:

Bubblesort ist mit das einfachste Verfahren - wo hakt es denn?


:oops: Mein Infolehrer hat gesagt wir sehen uns nur Quicksort an, weil das einfacher ist. Man soll halt nicht alles glauben :lol:

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Grenzgaenger
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 22.05.08 23:26 
user profile iconHidden hat folgendes geschrieben:
user profile iconGausi hat folgendes geschrieben:
Na toll. Bubblesort ist zu kompliziert, also nimmt man Quicksort, ja? :lol:

Bubblesort ist mit das einfachste Verfahren - wo hakt es denn?


:oops: Mein Infolehrer hat gesagt wir sehen uns nur Quicksort an, weil das einfacher ist. Man soll halt nicht alles glauben :lol:


tja, glaub niemals etwas, was du nicht selbst probiert hast :roll: