Thema: Delphi Stream

Einzelnen Beitrag anzeigen

Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.641 Beiträge
 
#2

Re: Stream

  Alt 6. Jun 2007, 09:20
I would keep a seperate hashtable with the keywords and the specific filenames. Searching in a well sorted hashtable is a lot faster than running around in a stream, because you would have to scan the whole stream (worst case) to find the keyword - in the (sorted) hashtable you only have to match up the hash value, and you can do that character for character, so when you have the hash abcdef and you start at the beginning and find baaaaa in the list you know that you don't have to look further because there won't be another hash starting with an a later on.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat