首页 > 其他 > 详细

Combinations

时间:2015-03-09 12:45:22      阅读:189      评论:0      收藏:0      [点我收藏+]

Combinations

问题:

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.

思路:

  dfs + 回溯

我的代码:

 

学习之处:

  • 常见的dfs+回溯模板

  

void dfs()
{
     for(所有情况)
     {
            采用情况
            dfs()
            不采用情况    
     }                   
}    

Combinations

原文:http://www.cnblogs.com/sunshisonghit/p/4323125.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!