摘要: 题目:Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in 阅读全文
posted @ 2018-02-27 15:08 荒野第一快递员 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three intege 阅读全文
posted @ 2018-02-27 12:29 荒野第一快递员 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum 阅读全文
posted @ 2018-02-27 12:02 荒野第一快递员 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two en 阅读全文
posted @ 2018-02-27 10:35 荒野第一快递员 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 转载至http://blog.csdn.net/hk2291976/article/details/51107778 问题介绍 这是个超级超级经典的分治算法!!这个问题大致是说,如何在给定的两个有序数组里面找其中的中值,或者变形问题,如何在2个有序数组数组中查找Top K的值(Top K的问题可以转 阅读全文
posted @ 2018-02-26 10:56 荒野第一快递员 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the l 阅读全文
posted @ 2018-02-26 10:03 荒野第一快递员 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目: Implement pow(x, n). Example 1: Example 2: 题意及分析:实现求x的n次方,使用分治法,复杂度降低到log2n 代码: 阅读全文
posted @ 2018-01-23 12:40 荒野第一快递员 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your m 阅读全文
posted @ 2018-01-23 09:41 荒野第一快递员 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were in 阅读全文
posted @ 2018-01-18 10:23 荒野第一快递员 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: [ 阅读全文
posted @ 2018-01-15 15:08 荒野第一快递员 阅读(263) 评论(0) 推荐(0) 编辑