随笔分类 -  数据结构算法

几种常见的排序算法总结
摘要:*****选择排序***** 方法描述:首先找到第一个最小的数,和第一个数交换;然后从剩下的找出最小的与第二个交换,以此类推。效率: 长度为N的数组,大约N2/2比较,N次交换特点: 1.运行时间和输入无关,有序数组,全部相等的数组,随机数组所用时间一样,没有充分利用输入的初始状态。 2.数据移动最 阅读全文

posted @ 2016-07-30 19:04 占海涛 阅读(777) 评论(0) 推荐(0)

LeetCode题解 343.Integer Break
摘要:题目:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum 阅读全文

posted @ 2016-04-28 10:15 占海涛 阅读(459) 评论(0) 推荐(0)

导航