Autor Beitrag
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mi 06.12.06 17:23 
Hi,
weiß jemand von euch wie man aus einer Stringlist die größte Zahl heraussuchen kann :?:
Leuchtturm

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 06.12.06 17:35 
Schnell QuickSort drüber, letzter Wert nehmen, fertig.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 06.12.06 17:36 
Moin!

Stringlisten enthalten üblicherweise - oh Wunder - Strings. ;) Wenn diese Zahlen darstellen, dann kannst du doch mit StrToInt(SL.Strings[i]) daraus wieder z.B. einen Integer machen.

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 06.12.06 17:37 
Moin!

user profile iconGTA-Place hat folgendes geschrieben:
Schnell QuickSort drüber, letzter Wert nehmen, fertig.

Hehe, mach doch mal, wird nicht klappen. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 06.12.06 17:38 
Vorher halt noch in en Array of Integer schreiben, hab ich doch beim Gewinnspiel auch gemacht.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 06.12.06 17:43 
Moin!

user profile iconGTA-Place hat folgendes geschrieben:
Vorher halt noch in en Array of Integer schreiben, hab ich doch beim Gewinnspiel auch gemacht.

a) ist nach Stringlisten gefragt, nicht nach array of Integer,
b) hast du zuerst nichts von Umwandlung der Strings in Integer gesagt, was aber hier wesentlich ist!
8)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mi 06.12.06 17:45 
Danke :zustimm:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.12.06 18:27 
Die ganze Liste sortieren, nur um die größte Zahl zu finden? Ist das nicht ein bisschen mit Kanonen auf Spatzen geschossen?

Die größte Zahl finde ich mit einem Durchlauf, als in O(n). Sortierung dürfte in den meisten Fällen deutlich schlechter sein ;-)

Die größte Zahl finden sollte doch einfach so gehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
  groesste, aktuell : Integer;
  i : Integer;
begin
  groesste := myList[0];
  for i:=1 to myList.Count-1 do
  begin
    aktuell := StrToInt(myList[i]);
    if aktuell > groesste then
      groesste := aktuell;
  end;
end;

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 06.12.06 18:28 
user profile iconNarses hat folgendes geschrieben:
Moin!

user profile iconGTA-Place hat folgendes geschrieben:
Vorher halt noch in en Array of Integer schreiben, hab ich doch beim Gewinnspiel auch gemacht.

a) ist nach Stringlisten gefragt, nicht nach array of Integer,
b) hast du zuerst nichts von Umwandlung der Strings in Integer gesagt, was aber hier wesentlich ist!
8)

cu
Narses

Du machst grundsätzlich aus ner Mücke einen Elefanten? Thema ende.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 06.12.06 18:48 
Moin!

user profile iconGTA-Place hat folgendes geschrieben:
Du machst grundsätzlich aus ner Mücke einen Elefanten?

Ich mache auf Probleme bzw. Unklarheiten in deinem Tipp aufmerksam, ich sehe da jetzt keinen Zusammenhang zu Dickhäutern... :roll: Gib gleich vernünftige Tipps, dann sehe ich auch keine Veranlassung, diese zu korrigieren. ;)

user profile iconGTA-Place hat folgendes geschrieben:
Thema ende.

a) ist das nicht dein Thema, also wirst du es auch schlecht beenden können,
b) kann ich durchaus selbst festlegen, wann ich ein Thema für beendet ansehe. :mrgreen:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 06.12.06 18:55 
Ich meinte auch das Thema zwischen dir und mir und das ist jetzt ENDGÜLTIG ZU ENDE!!

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 06.12.06 18:59 
Solltet Ihr diskutieren wollen, ob Eure Diskussion zu Ende ist, macht das bitte per PN ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 06.12.06 19:03 
Moin!

@user profile iconLeuchtturm: Markierst du den Thread noch entsprechend, wenn dein Problem gelöst ist? Danke. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.