1211
1211 

所属分类:数据结构
开发工具:Visual C++
文件大小:393KB
下载次数:26
上传日期:2014-11-14 14:59:10
上 传 者ffrqw
说明:  Description 给出一棵二叉树的结构,判断这棵二叉树是不是完全二叉树。必须使用二叉树类实现。 Input Format 输入文件一共包含N+1行。 第一行含有一个正整数N,代表树中结点总数。 第二行到第N+1行,每行包含二个整数。其中第i行的二个整数Pi,Qi,代表结点i的左孩子为Pi,右孩子为Qi。若Pi=0,则表明结点i没有左孩子。同样的,若Qi=0,则表明结点i没有右孩子。(第i行指的是这N行中的第i行) Output Format 如果给出的树是完全二叉树,则输出 Y ,否则输出 N 。(均不包含引号)
(Description is given a binary tree structure to determine binary tree is not complete binary tree. You must use a binary tree class implementation. Input Format input file contains a total N+1 line. The first line contains a positive integer N, the total number of nodes in the tree representation. N+1 second line to the first line, each line contains two integers. Wherein the i-th row of two integers Pi, Qi, representative of the left child node i is Pi, the right child of Qi. If Pi = 0, it indicates that there is no left child node i. Similarly, if Qi = 0, it indicates that there is no right child node i. (Referring to the i-th row in the first line of this N i lines) Output Format If the tree is a complete binary tree is given, the output ' Y' , otherwise the output ' N' . (Exclude quotes))

文件列表:
1211\1211.cbp (1175, 2014-10-28)
1211\1211.depend (98, 2014-10-31)
1211\1211.layout (243, 2014-11-01)
1211\123.cpp (152, 2014-10-28)
1211\123.exe (909090, 2014-10-28)
1211\123.o (1210, 2014-10-28)
1211\bin\Debug\1211.exe (951124, 2014-10-28)
1211\include\queue.h (758, 2014-10-28)
1211\main.cpp (5095, 2014-10-28)
1211\obj\Debug\main.o (54221, 2014-10-28)
1211\queue.c (2, 2014-10-28)
1211\src\queue.cpp (599, 2014-10-28)
1211\obj\Debug\src (0, 2014-10-28)
1211\bin\Debug (0, 2014-10-28)
1211\obj\Debug (0, 2014-10-28)
1211\bin (0, 2014-10-28)
1211\include (0, 2014-10-28)
1211\obj (0, 2014-10-28)
1211\src (0, 2014-10-28)
1211 (0, 2014-11-01)

近期下载者

相关文件


收藏者