![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 63
天然居
这个作者很懒,什么都没留下…
展开
-
求数组的子数组之和的最大值(分治法)
记得在上《软件工程》的时候的某个夏天的下午,吴一帆老师出原创 2014-09-20 17:41:26 · 1129 阅读 · 0 评论 -
LeetCode | Median of Two Sorted Arrays
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).一开始没看清题目,以为O(m+n)的时间复原创 2015-01-08 10:50:28 · 488 阅读 · 0 评论 -
LeetCode | Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe原创 2015-01-07 18:43:24 · 381 阅读 · 0 评论 -
LeetCode | Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",原创 2014-10-03 20:14:44 · 458 阅读 · 0 评论 -
LeetCode | Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the larges原创 2014-10-03 10:17:06 · 527 阅读 · 0 评论 -
LeetCode | Reverse Words in a String
leetcode原题:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:原创 2014-10-03 19:10:36 · 563 阅读 · 0 评论 -
一些网站地址
http://www.codeproject.comhttp://c.biancheng.net/cpp/html/2727.htmlhttp://man.linuxde.net/http://www.csie.ntnu.edu.tw/~u91029/Algorithm.htmlhttp://visualgo.net/https://www.byvoid.com原创 2014-12-31 11:17:15 · 586 阅读 · 0 评论 -
一致性哈希算法 - Consistent Hashing
一、简单介绍一致性哈希算法 分布式存储中,常常涉及到负载均衡问题,由于有多个数据存储服务器。因此当一个对象被保存时候,它究竟应该存放到哪个数据存储服务器上面呢?这就是负载均问题。 又例如:现在假设有一个网站,最近发现随着流量增加,服务器压力越来越大,之前直接读写数据库的方式已经不能满足用户的访问,于是想引入 Memcached 作为缓存机制。现在一共引入三台转载 2014-12-18 17:21:53 · 556 阅读 · 0 评论 -
最大子序列、最长递增子序列、最长公共子串、最长公共子序列、字符串编辑距离
最大子序列最大子序列是要找出由数组成的一维数组中和最大的连续子序列。比如{5,-3,4,2}的最大子序列就是 {5,-3,4,2},它的和是8,达到最大;而 {5,-6,4,2}的最大子序列是{4,2},它的和是6。你已经看出来了,找最大子序列的方法很简单,只要前i项的和还没有小于0那么子序列就一直向后扩展,否则丢弃之前的子序列开始新的子序列,同时我们要记下各个子序列的和,最后找到和最大的转载 2014-10-10 18:34:04 · 455 阅读 · 0 评论 -
求数组的子数组之和的最大值(动态规划)
大三上学期虽然上过《算法分析》原创 2014-09-20 20:46:25 · 849 阅读 · 3 评论 -
LeetCode | Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link原创 2015-01-09 11:02:40 · 438 阅读 · 0 评论