Re: Help!!


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by kalpol on July 12, 2001 at 01:59:58:

In Reply to: Help!! posted by Natalie on July 12, 2001 at 01:09:12:

Here's Aaron's tester all worked out - my remove function is bad, I've found by using it. You might have to make everything in your tree class public for this to work.

int main()
{
AVLtree Test;
for(int c = 0; c < 200000;c++)
{
int x = rand();
cout << (x & 1) << " " << ((x >> 1)%0xF) << endl;
if(x & 1)
Test.insert (((x >> 1)% 0xF));
else
{
//if(((x >> 1)%0xF) == 8)
//Test.printTree();
Test.remove(((x >> 1)% 0xF));
}
if(!Test.verifyAVL(Test.treeroot))
{
cout << "oh poop\n";
Test.printTree();
exit(1);
}
}
return 0;
}


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]