正在加载图片...
template <class Type> istream operator >>( istream &in Binary Tree<Type>& tree 重载 abstracting操作符“>”,用于输入数据元素并同时创建 棵 /叉树Tree Type item cout << Construct binary tree: n cout<< input data(end with"<< Tree. Refvalue <<" tem while( item !=Tree. RefValue Tree. Insert(iem);/将数据元素tem插入到二叉树Tree中 cout < Input dataend with"<< Tree. Refvalue<<") in > item return in 20212222021/2/22 16 template <class Type> istream & operator >> ( istream & in , BinaryTree<Type> & Tree ) //重载abstracting 操作符“ >> ” ,用于输入数据元素并同时创建一 棵 //二叉树Tree { Type item ; cout << “ Construct binary tree : \n ” ; cout << “ input data ( end with ” << Tree.RefValue << “ ) : ” ; in >> item ; while ( item != Tree.RefValue ) { Tree.Insert ( item ) ; //将数据元素item 插入到二叉树Tree 中 cout << “ Input data ( end with ” << Tree.RefValue << “ ) : ” ; in >> item ; } return in ; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有