
算法
MRLeeCH
明天会更好
展开
-
合并算法
分治 算法 ,原创 2015-12-08 16:07:50 · 812 阅读 · 0 评论 -
递归一
//// ViewController.m// 算法测试//// Created by apple on 16/3/30.// Copyright © 2016年 李重阳. All rights reserved.//#import "ViewController.h"int firstCount = 0;int inputNum[3] = {0};@interface Vi原创 2016-03-31 10:02:27 · 287 阅读 · 0 评论 -
递归8_全排列
static int count = 0;@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from原创 2016-03-31 18:02:02 · 417 阅读 · 0 评论 -
递归7_旗子的移动问题
static int count = 1;@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from原创 2016-03-31 17:23:41 · 934 阅读 · 0 评论 -
递归6_简单的0/1背包问题 去除相同的数
static int maxM = 5;static int count = 0;@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the v原创 2016-03-31 16:25:47 · 515 阅读 · 0 评论 -
递归5_简单的0/1背包问题
static int maxM = 5;static int count = 0;@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the v原创 2016-03-31 15:58:09 · 715 阅读 · 0 评论 -
递归4_数组逆序
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. int a[10] = {0,1,2,3,4,5,6,7,8,9}; inversion(10,a);}void inversion(in原创 2016-03-31 14:38:49 · 672 阅读 · 0 评论 -
递归二 - 汉诺塔
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. hanNuoTa('A','C','B',3);}void hanNuoTa(char a,char c ,char b,int n) {原创 2016-03-31 11:49:54 · 273 阅读 · 0 评论 -
递归二 最大公约数
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. printf("最大公约数%d",greatestCommonFactor(98,63));}int greatestCommonFactor(原创 2016-03-31 11:22:30 · 280 阅读 · 0 评论 -
二叉搜索 方法
//// ViewController3.m// Sort//// Created by apple on 15/12/12.// Copyright © 2015年 apple. All rights reserved.//#import "ViewController3.h"@interface原创 2015-12-12 14:09:33 · 318 阅读 · 0 评论 -
快速排序
快速排序原创 2015-12-07 17:55:55 · 309 阅读 · 0 评论 -
递归3_计算多个数字
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. printf("sum = %d",numOfSum(4, 5));}/** * 题目:求s=a+aa+aaa+aaaa+aa...a的原创 2016-03-31 14:03:20 · 358 阅读 · 0 评论