// BTREEb.CPP // Example of B-tree bug, BC 4.02 // The TBinarySearchTreeIteratorImp fails to stop // Program outputs: 1 2 3 4 3 // Vesa Lappalainen 19.11.1994, vesal@jyu.fi #include #include int main(void) { TBinarySearchTreeImp b; TBinarySearchTreeIteratorImp bi(b); b.Add(3); b.Add(1); b.Add(2); b.Add(4); cout << "Tree:\n"; for (bi.Restart(); bi; bi++) cout << bi.Current() << " "; cout << "\n"; return 0; }