• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
peer
............
博客园    首页    新随笔    联系   管理    订阅  订阅
2014年1月12日
八皇后-递归
摘要: 重写八皇后,最开始用双层循环,然后用递归重写,还是递归易懂,优雅 1 #include 2 #include 3 #include 4 #include 5 #include "stack_seq_generic.h" 6 7 #define QUEEN 4 8 9 typedef struct{ 10 int x; 11 int y; 12 } Point; 13 14 BOOL in_border(int x){ 15 if (x>=0 && xtop; 23 Point *base = (Point *)s->base; 2... 阅读全文
posted @ 2014-01-12 14:19 peerlessly 阅读(738) 评论(1) 推荐(1)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3