随笔分类 -  算法相关

算法相关
摘要:原文出处: 1. 白话经典算法系列之八 MoreWindows白话经典算法之七大排序总结篇 2. 面试常用算法总结——排序算法(java版) 3. 常见排序算法小结 本篇主要整理了冒泡排序,直接插入排序,直接选择排序,希尔排序,归并排序,快速排序,堆排序七种常见算法,是从上面三篇博文中摘抄整理的,非 阅读全文
posted @ 2017-05-05 22:00 细雨落花 阅读(14167) 评论(0) 推荐(0)
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1.The length o 阅读全文
posted @ 2017-02-17 17:53 细雨落花 阅读(140) 评论(0) 推荐(0)
摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Given an array of integers where 阅读全文
posted @ 2017-02-17 16:37 细雨落花 阅读(295) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2017-02-17 12:06 细雨落花 阅读(265) 评论(0) 推荐(0)
摘要:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文
posted @ 2017-02-17 11:21 细雨落花 阅读(148) 评论(0) 推荐(0)
摘要:Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at lea 阅读全文
posted @ 2017-02-15 16:24 细雨落花 阅读(225) 评论(0) 推荐(0)
摘要:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2017-02-10 18:01 细雨落花 阅读(153) 评论(0) 推荐(0)
摘要:Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 例 i = 5的生成过程: i = 0 row = [1]; 内层循环不执行; allrows 阅读全文
posted @ 2017-02-10 12:13 细雨落花 阅读(143) 评论(0) 推荐(0)
摘要:原文链接:http://www.cnblogs.com/jerrylead/archive/2011/04/06/2006910.html K-means聚类算法 K-means也是聚类算法中最简单的一种了,但是里面包含的思想却是不一般。最早我使用并实现这个算法是在学习韩爷爷那本数据挖掘的书中,那本 阅读全文
posted @ 2016-07-15 14:51 细雨落花 阅读(1708) 评论(0) 推荐(0)
摘要:原文链接:http://blog.csdn.net/fwing/article/details/4942886 现在的推荐系统特别火啊。做得最好的应该是Amazon了。 上面是Amazon的图书推荐。 用的就是著名的 协同过滤(Collaborative filtering)算法。 我们用一个简单的 阅读全文
posted @ 2016-07-15 14:11 细雨落花 阅读(835) 评论(0) 推荐(0)