[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++?



On 18 Dec 2001, at 17:29, Mads Bondo Dydensborg wrote:

> Hejsa
>
> 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?
>
> Andre tips modtages også gerne.

Hvis hukommelse ikke er et stort problem kunne du bare indsætte
alle suffix strenge i din ordbog hvor dit satellitdatum er en pointer til
den fuldstændige streng. Indsæt dette i enten std::map eller
std::hash_map (som dog endnu ikke er en del af standarden men
som praktisk alle STL implementeringer understøtter) og så har du
en hurtig og let implementerbar løsning. Jeg tror faktisk ikke at
denne løsning er dyrere mht. hukommelsesforbrug end en naiv
implementering af et trie (dvs. uden grenfoldning). Problemet i
denne forbindelse er at lave "isolerede" strenge typisk vil resultere i
deltræer med en masse NULL pointers, som selvfølgelig spilder
hukommelse.

Per


 
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] *