树
0.1
数据结构_第6章
|
测试:判断二叉树是否为完全二叉树 More...
Go to the source code of this file.
Functions | |
const std::string | data_file_name ("ch6_4.result") |
保存测试数据的文件名 More... | |
static bool | GenTreeData (const char *_file_path="./test0.txt", const char *empty_flag="@") |
生成一个文件,内容是一棵二叉树的层次遍历 More... | |
template<typename T , typename Comparator > | |
static void | print_test_result (const Tree::binaryTree< T, Comparator > &binary_tree, const typename Tree::binaryTree< T, Comparator >::value_type &flag, std::ostream &out=std::cout) |
(测试用)将二叉树类的多种方法的输出插到输出流 More... | |
int | main (int argc, char const *argv[]) |
template<class T , typename Comparator > | |
void | print_test_result (const Tree::binaryTree< T, Comparator > &binary_tree, const typename Tree::binaryTree< T, Comparator >::value_type &flag, std::ostream &out) |
(测试用)将二叉树类的多种方法的输出插到输出流 More... | |
测试:判断二叉树是否为完全二叉树
See the file LICENSE in the top directory of this distribution for more information.
Definition in file ch6_4.cc.
const std::string data_file_name | ( | "ch6_4.result" | ) |
|
static |
int main | ( | int | argc, |
char const * | argv[] | ||
) |
Definition at line 51 of file ch6_4.cc.
References Tree::binaryTree< T, Comparator >::createTree(), data_file_name(), GenTreeData(), and print_test_result().
void print_test_result | ( | const Tree::binaryTree< T, Comparator > & | binary_tree, |
const typename Tree::binaryTree< T, Comparator >::value_type & | flag, | ||
std::ostream & | out = std::cout |
||
) |
(测试用)将二叉树类的多种方法的输出插到输出流
T | 二叉树存储的数据的类型 |
Comparator | 函数对象,用于比较T类型的数据:lhs < rhs |
binary_tree | 二叉树类的对象 |
flag | 类T的对象,表示空结点的特殊标记 |
out | 输出流对象,要求是ostream类及其派生类的对象,如std::cout,或ofstream类的对象 |
Definition at line 182 of file ch6_4.cc.
References Tree::binaryTree< T, Comparator >::CountDegreeTwo(), Tree::binaryTree< T, Comparator >::height(), Tree::binaryTree< T, Comparator >::height_loop(), Tree::binaryTree< T, Comparator >::inOrder(), Tree::binaryTree< T, Comparator >::inOrder_loop(), Tree::binaryTree< T, Comparator >::isCompleteTree(), Tree::binaryTree< T, Comparator >::isFullBinaryTree(), Tree::binaryTree< T, Comparator >::levelOrder(), Tree::binaryTree< T, Comparator >::postOrder(), Tree::binaryTree< T, Comparator >::postOrder_loop(), Tree::binaryTree< T, Comparator >::preOrder(), Tree::binaryTree< T, Comparator >::preOrder_loop(), Tree::printBinaryTree(), Tree::binaryTree< T, Comparator >::size(), and Tree::binaryTree< T, Comparator >::size_loop().
|
static |
(测试用)将二叉树类的多种方法的输出插到输出流
T | 二叉树存储的数据的类型 |
Comparator | 函数对象,用于比较T类型的数据:lhs < rhs |
binary_tree | 二叉树类的对象 |
flag | 类T的对象,表示空结点的特殊标记 |
out | 输出流对象,要求是ostream类及其派生类的对象,如std::cout,或ofstream类的对象 |
Definition at line 175 of file ch6_1.cc.
Referenced by main().