Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Binary Search Tree Debug Question

by FunkyMonk (Chancellor)
on Aug 13, 2011 at 13:56 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-04-18 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found