Project #74288 - Binary Search Tree iterator

Use the text Binary Search Tree class as a starter, and add an iterator so my test code can iterate linearly through a tree (without recursion).  Specifically, I require that you remove all uses of the <vector> Class or any other STL auxiliary storage.  The iterator actually iterates through the actual tree.   Limit the #include lines to only <string> and <iostream>   Submit one file, named BST.h  A possible starter code from the text is BST.hPreview the documentView in a new window

#include "BST.h"
using namespace std;
// CS212, Spring 2014, Program #5
void main()
{
  // Create a binary search tree for strings
  BST<string> tree;

  // Add elements to the tree
  tree.insert("America");
  tree.insert("Canada");
  tree.insert("Russia");
  tree.insert("France");

  // Create an Iterator
  Iterator<string> iterator = tree.begin();

  tree.insert("Texas"); // modify the tree

  // Traverse a binary tree using iterators
  while (iterator != tree.end()) 
  {
     cout << *iterator << " ";
     iterator++;
  }
  // Texas is missing, FIX IT!!!!
  system("pause");
}

Subject Computer
Due By (Pacific Time) 06/17/2015 11:35 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy