Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Categories. Table of Contents. Trees?

by monarch (Priest)
on Nov 04, 2005 at 01:26 UTC ( #505574=note: print w/ replies, xml ) Need Help??


in reply to Categories. Table of Contents. Trees?

It sounds like you may be looking for a basic tutorial on the definition of a tree structure. If that is so, I recommend having a look at Wikipedia (tree structures) which I'm finding has good introductions to basic computer science concepts such as this these days..

As an aside, I think Perl lends itself quite naturally to tree structures. Having references makes building trees very simple. For example, consider a table of contents:

my %contents = ( 1 => [ 'Introduction', undef ], 2 => [ 'Design', { 1 => [ 'Wheels', undef ], 2 => [ 'Frame', undef ], 3 => [ 'Electronics', { 1 => [ 'Dashboard', undef ], 2 => [ 'Fuel Injection', undef ], }, 4 => [ 'Petrol Tank', undef ], }, 3 => [ 'Summary', undef ], );

Merely defining things these ways is, by definition, a tree. If references are tripping you up, then read about pointers.. and re-read until you become more comfortable with this concept.


Comment on Re: Categories. Table of Contents. Trees?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-07-05 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls