[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] God datastruktur til tab completion i C++?



Mads Bondo Dydensborg <sslug@sslug> writes:

> Jeg skal implementere/understøtte tab completion på vilkårlige strenge.
> 
> Jeg tænkte på om der var nogen der havde nogen erfaring med en god
> datastruktur der meget gerne måtte være en del af STL?

Hvis du virkelig har en enorm mængde strenge som du skal lavet meget
tab completion på, kunne du lægge dem i et 25-vejs træ hvor hver node
indeholder eet bogstav, aka "trie":

http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Tree/Trie.html

Se også Knuth vol. 3, side 492- :)

STL implementering af en trie er vist sådan noget man får for som
lektier :)

Men jeg kan ikke forestille mig at tab completion skulle være en
særlig kritisk del af din applikation. Derfor burde du kunne du nøjes
med at have dine strenge i en enhver sorteret container. Find da den
første streng som delvist matcher din streng og fortsæt indtil du ikke
kan finde flere matches.

I første omgang, abstrahér og optimér når du finder ud at at det er et
problem.



-- 
===============================================================
<sslug@sslug>     Herlev, Denmark     Software Designer
<URL:http://www.andreasen.org/>   <*>   Eicon Networks Research
===============================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *