Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Binary Search Tree Debug Question

by FunkyMonk (Chancellor)
on Aug 13, 2011 at 13:56 UTC ( #920171=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ( $tree->{VALUE} > $value ) { insert( $tree->{LEFT}, $value ) }
    elsif ( $tree->{VALUE} < $value ) { insert( $tree->{RIGHT}, $value )
    
  2. or download this
    if ( $tree->{VALUE} > $value ) { insert( $tree->{LEFT}, $value ) }
    elsif ( $tree->{VALUE} < $value ) { insert( $tree->{RIGHT}, $value ) 
    else { warn "$value duplicated" }
    
  3. or download this
    if ( $tree->{VALUE} >= $value ) { insert( $tree->{LEFT}, $value ) }
    elsif ( $tree->{VALUE} < $value ) { insert( $tree->{RIGHT}, $value )
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-12-01 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?