文件名称:1211

  • 所属分类:
  • 数据结构常用算法
  • 资源属性:
  • [C/C++] [源码]
  • 上传时间:
  • 2014-11-14
  • 文件大小:
  • 393kb
  • 下载次数:
  • 2次
  • 提 供 者:
  • z**
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

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)
(系统自动生成,下载前可以参看下载内容)

下载文件列表





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

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org