Autor Beitrag
Fabian E.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Di 29.07.08 10:21 
Hallo zusammen, ich habe eine Hashmap mit Zahlen als Keys und Data. Die Keys sind alle verschieden, beim Inhalt gibt es sehr viele gleiche Zahlen. Nun möchte ich gerne eine Stringliste erhalten, in der in jeder Zeile der Key + der Inhalt steht. Soweit kein Problem. Zusätlich soll allerdings noch hintendran eine GruppenID stehen. Diese wird aus dem Inhalt generiert. Alle Keys, die den selben Inhalt haben bekommen auch die selbe ID. Hat jemand eine Idee wie man das lösen könnte?
Mir schwirrt hier grad alles im Kopf rum hier ein Stück C# da ein bisschen Delphi... Ich hab Kopfweh... :(

Wär schön wenn mir jemand helfen könnte :)
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 31.07.08 18:32 
Ah, immer noch deine 13MB-Datei ...

Wioll diese Gruppen-ID bzgl. gleichen Inhaltes aussehen?

Also meinst Du jetzt:

Key(Inhalt:ID)
1(0 8 1 5:14)
4(4 7 11:22)
7(0 8 1 5:14)
...
Oder soll jeder Key eine eindeutige ID bekommen, unabhängig vom Inhalt, ist diese ID vorgegeben, ...???

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 01.08.08 03:05 
Ganz einfach: Hashe den Inhalt und nimm das Ergebnis als GruppenID. Je nach Hash sollte das Kollisionsfrei über die Bühne gehen.

Im Endeffekt baust du also einen 2. Index über die Daten.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."