Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java SE 综合讨论区
» 编程/算法/API
打印话题 寄给朋友 订阅主题 |
作者 | 树的遍历问题 |
pinkpig1982
发贴: 1 积分: 0 |
于 2005-12-05 17:12
这几天一直在烦一个很烦的问题 有这样一个图,图在附件 根据这个图我用这样一个数组存储节点间的关系: int[][] tempList = new int[13][2]; tempList[0] = {1,3}; tempList[1] = {3,6}; tempList[2] = {3,7}; tempList[3] = {3,8}; tempList[4] = {6,9}; tempList[5] = {6,10}; tempList[6] = {7,11}; tempList[7] = {7,12}; tempList[8] = {8,2}; tempList[9] = {9,2}; tempList[10] = {10,2}; tempList[11] = {11,2}; tempList[12] = {12,2}; 希望根据这个数组print出下面的东西: 1(); int value3 = 3(); if(value3 ...) { int value6 = 6(); if(value6 ...) { 9(); 2(); } else if(value6 ...) { 10(); 2(); } } else if(value3 ...) { int value7 = 7(); if(value7 ...) { 11(); 2(); } else if(value7 ...) { 12(); 2(); } } else if(3 ...) { 8(); } 这个图和print出来的东西只是举例,其它不同形状的图也要能按照这个规则print出来 我真是做了好久都做不出来!所以请各位帮个忙吧,小女子在这里谢过了! abc.gif (167.8k) |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
9292 | 树的遍历问题 | pinkpig1982 | 1864 | 2005-12-05 17:12 |
7053 | Re:树的遍历问题 | justforfun | 53 | 2005-12-06 06:46 |
6932 | Re:树的遍历问题 | ftang | 345 | 2005-12-09 06:23 |
6683 | Re:树的遍历问题 | ranchgirl | 56 | 2005-12-09 09:10 |
7182 | Re:树的遍历问题 | ftang | 54 | 2005-12-09 23:39 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |