Question
Asked by:
bobbyboucher
bobbyboucher from UGA
Rating : No Rating
Questions Asked: 22
Tutorials Posted: 0
 

$15.00 Binary Search Tree C++

Q:
Please see attached for a short assignment.
 
Attachments:
p5.pdf (84K)
Want to take a stab at the bounty and post a tutorial? Need clarification? Join us now or log in! Read more on how this works.
 
Available Tutorials to this Question
Posted by:
rainman
rainman from NCU
Rating (11): A+
Questions Asked: 0
Tutorials Posted: 113, earned $226.03
 

$15.00 Binary Search Tree Using Reminders. Compiled, Tested, Works as Specified.

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Nov 02, 2008 at 10:46:58PM
A:
Preview: ... Node* left;
Node* right;
};

Node::Node(Reminder r)
{

reminder = r;

left = NULL;
right = NULL;
}

void Node::print()
{
reminder.print();
}


class BinaryTree
{
public:
BinaryTree();
~BinaryTree();

void insert(Reminder r);

void clear();

void preorder();
void inorder();
void postorder();

int getLevels();

void printReminders();

private:
Node* root;

void preorder(Node* n);
void inorder(Node* n);
void postorder(Node* n);

void removeNode(Node*& n);

void insert(Node*& n, Reminder r);

int levels(Node* n);

};

BinaryTree::BinaryTree()
{
root = NULL;
}

BinaryTree::~BinaryTree()
{
removeNode(root);
}

void BinaryTree::removeNode(Node*& n)
{
if (n)
{
removeNode(n->left);
removeNode(n->right);
delete n;
n = NULL;
}
}

void ...

The full tutorial is about 1216 words long plus attachments and additional clarification.

Attachments:
bstree.cpp (5K)
Reminders.txt (0K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty