文件名称:1211
介绍说明--下载内容均来自于网络,请自行研究使用
Descr iption
给出一棵二叉树的结构,判断这棵二叉树是不是完全二叉树。必须使用二叉树类实现。
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 。(均不包含引号)-Descr iption 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)
给出一棵二叉树的结构,判断这棵二叉树是不是完全二叉树。必须使用二叉树类实现。
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 。(均不包含引号)-Descr iption 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
....\1211.depend
....\1211.layout
....\123.cpp
....\123.exe
....\123.o
....\bin\Debug\1211.exe
....\include\queue.h
....\main.cpp
....\obj\Debug\main.o
....\queue.c
....\src\queue.cpp
....\obj\Debug\src
....\bin\Debug
....\obj\Debug
....\bin
....\include
....\obj
....\src
1211