[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
 

Smart måde at checke på?



Hej

Jeg har ca. 6800 patentkoder af formen EP01234567.

Jeg vil gerne lavet et filter således at det læser en liste
af kendte patent koder fra en fil, og fra stdin læser en strøm,
der også indeholder patent koder, og filtret skal udskrive til
stdout alle de patentkoder i stdin, der IKKE var i filen.
Dvs. nye patenter. Antallet af input er formodeligt i størrelses
ordnen 10k patent koder. Så der er mange af dem!

Hvad er den mest praktiske måde at implementere dette på?

Antallet er stort, så jeg vil nødigt lave et array og så
traversere arrayet for hver input, det lyder også for let.
Ditto ville det være kedeligt at lime dem sammen til en
stor streng, og så bruge et regulært udtryk i en stor streng

Min idee var at lave en træstruktur fordi så bør jeg erstatte
O(N) med O(logB(N)) scaling for et eller andet B~10.

Jeg har dog nogle problemer med at hitte ud af hvordan
man kan lave træ strukturer i Perl.

Jeg har rodet med autovivification som:

my %hash;

$hash{'E'}{'P'}{'0'}{'1'}.... = 1;

Dette bør give en hash af en hash af en ..
Problemet er bare at noder ikke kan have information og
subnoder samtidigt.

Fx. vil
$hash{'E'}{'P'}{'0'}  = 2; 

slette noden med 1 i ovenover fordi EPO01... er en submode af EP0.

Nogle smarte ideer, ellers må jeg lave det i C/C++.

-- 
  Mvh. Carsten Svaneborg


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:54 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] *