Does cheating produce faster searches?

Liste des GroupesRevenir à cl tcl 
Sujet : Does cheating produce faster searches?
De : luc (at) *nospam* sep.invalid (Luc)
Groupes : comp.lang.tcl
Date : 25. Sep 2024, 21:01:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240925170149.3463bec9@lud1.home>
Suppose I have a large list. Very large list. Then I want to search
for an item in that string:

% lsearch $list "string"

Now, suppose I have many lists instead. One list contains all the items
that begin with the letter a, another list contains all the items that
begin with the letter b, another list contains all the items that begin
with the letter c, and so on. Then I see what the first character in
"string" is and only search for it in the one corresponding list.
Would that be faster? I somehow suspect the answer is 'no.'

Bonus question: what about sqlite operations? Would they be faster if
I had one separate table for each initial letter/character?

TIA

--
Luc
>


Date Sujet#  Auteur
25 Sep 24 * Does cheating produce faster searches?5Luc
25 Sep 24 +- Re: Does cheating produce faster searches?1Rich
27 Sep 24 `* Re: Does cheating produce faster searches?3Shaun Deacon
27 Sep 24  `* Re: Does cheating produce faster searches?2Luc
27 Sep 24   `- Re: Does cheating produce faster searches?1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal