HW2-1 - use warnings; # "my" variables declared...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 use warnings # "my" variables declared here will be global in this entire # file my $r=0 my $i=0 my $c=0 my $temp=0 my $temp2=0 {package mytree #'mytree' will be a subclass of Tree::RB use Tree::RB @ISA ="Tree::RB" #the following lines include some files of Tree::RB that we need use Tree::RB::Node::_Constants use constant { ROOT => 0, CMP => 1, SIZE => 2, HASH_ITER => 3, } ################################################### # paste copies of 3 subroutines of Tree::RB here: # put, _left_rotate, and _right_rotate # you'll find them in the file RB.pm in your Perl site library # which in the windows installation is # C:\Perl\site\lib # look in directory Tree-RB-0.1 # # these are the 3 routines you'll need to modify for the hw ################################################### sub put { $c=0 my $self = shift my $key_or_node = shift or croak('key or node required') my $val = shift croak('value required') } my $cmp = $self->[CMP]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

HW2-1 - use warnings; # "my" variables declared...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online