- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 荷兰国旗问题
// FlagArrange.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include /* 由红白蓝三种颜色的球组成的序列,编写算法,使得该序列排列次序为红球,白球,蓝球,且时间复杂度为O(n); 思路:假设红白蓝三种颜色依次用数字1,2,3来
2014-02-25 21:19:26
585
原创 汉诺塔问题
// Hanoi.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include int count = 0; //全局变量,保存移动次数 /* 汉诺塔问题,将n个盘子从A移动至C,借助C,输出移动方式和移动次数 */ void Hanoi(int n, char A,
2014-02-23 00:07:14
726
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人