Autor Beitrag
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Do 30.10.08 12:05 
verdammt...ja hab übersehn, dass bei groß/kleinschreibung es langsamer wird, wenn es ignoriert werden soll...
compareStr mit längen-überprüfung vorher ist demnach das schnellste...doppelt so schnell, wie meine bisherige methode
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 10.11.08 19:38 
Du solltest für der Optimierung nicht bei der Implementierung ansetzen, sondern beim Algorithmus..! Ein schlecht implementierter Quicksort ist immer noch um Größenordnungen schneller als ein perfekt implementiert und hochoptimierter Bubblesort - und so ähnlich ist es hier auch.

Daher werfe ich einfach mal Suffix-Trees in die Runde. Ist zwar sicher etwas mehr Implementierungsaufwand, aber dafür baust du diese genau einmal auf (in linearer Zeit) und kannst dann in ebenfalls linearer Zeit darin suchen!

Gruß, Motzi

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!