Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Bijective data association structure?

by jlongino (Parson)
on Feb 27, 2003 at 19:35 UTC ( #239221=note: print w/ replies, xml ) Need Help??


in reply to Bijective data association structure?

You'll probably just want to build your hash as a circular linked list:

my $position_of = ( 'A' => { next_key => 'A#', prev_key => 'G#', # other stuff . . . }, 'A#' => { next_key => 'B', prev_key => 'A', # other stuff . . . }, ### in-between stuff 'G#' => { next_key => 'A', prev_key => 'G', # other stuff . . . }, );
Update: with circular linked lists you usually keep track of head/tail:
my $head = 'A'; my $tail = 'G#';

--Jim


Comment on Re: Bijective data association structure?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://239221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-09-19 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (138 votes), past polls