摘要:利用了树的中序遍历,不过是从右边到左边的中序遍历。 #include #include "tree.h"templatevoid outputTree(TreeNode *ptr,int totalSpaces){ if(ptr!=0) { outputTree(ptr->rightPtr,totalSpaces+5); for(int i=0;ige...
阅读全文
posted @ 2005-07-14 17:44
|
|||
随笔分类 - B.算法与数据结构
摘要:利用了树的中序遍历,不过是从右边到左边的中序遍历。 #include #include "tree.h"templatevoid outputTree(TreeNode *ptr,int totalSpaces){ if(ptr!=0) { outputTree(ptr->rightPtr,totalSpaces+5); for(int i=0;ige...
阅读全文
posted @ 2005-07-14 17:44
摘要:组合的算法 出处:http://community.csdn.net/Expert/topic/3143/3143703.xml?temp=.5916101 原作者:cxjddd (空浮无根) 内容简介: 本文讲述求一种求排列组合中的“组合”的算法。本算法通过组织选入组合的元素和未选入组合的元素之间次序,以方便求得下一个组合——更大的或更小...
阅读全文
posted @ 2005-07-13 18:47
摘要:#include #include // constant size must be defined as the array size for bucketSort to workconst int SIZE = 12; void bucketSort( int [] );void distributeElements( int [], int [][ SIZE ], int );void ...
阅读全文
posted @ 2005-07-13 18:44
|
|||