- 博客(3)
- 收藏
- 关注
原创 二叉树深度高度统计递归
static 注意就行了.. int max(int a,int b) { return a>b?a:b; } int countdepth(BinaryTreeNode * ptr) { static int x=0; if(ptr==0) retur
2011-08-28 11:31:05
243
原创 二叉树深度统计非递归
一个队列,一个标志 #include using namespace std; int countdepthNR(BinaryTreeNode * ptr) { int x=0; queueQueue; BinaryTreeNode * mark = new Bin
2011-08-28 11:29:43
138
原创 n 皇后,试探法。新手
#include #include bool check(int * Queen,int n) { int i; for(i=0;i { if(Queen[i]==Queen[n]||abs(Queen[i]-Queen[n])==n-i)return 0; }
2011-08-24 09:25:40
242
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人