Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-09-04 16:41:59
阅读次数:
173
代码:(function ($) { "use strict"; $.fn.pin = function (options) { var scrollY = 0, elements = [], disabled = false, $window = $(window); ...
分类:
Web程序 时间:
2014-09-02 22:38:25
阅读次数:
273
引言 快排采用分治法(Divide and Conquer)把一个list分为两个sub-lists。 算法步骤 1. 从数列中跳出一个元素,作为基准(pivot)。 2. 重新排序数列,所有比基准值小的元素(elements pivot)放在基准值后面,与基准值相等的数可以放在任意一边。此操作即为...
分类:
其他好文 时间:
2014-09-02 22:36:25
阅读次数:
298
背景项目中使用protobuf作为网络传输协议,最开始在项目中直接使用源代码编译,在真机上测试一直是正常的,直到某天开始在CPU是64 bit的设备上发现protobuf导致crash了,于是就开始尝试使用.a静态库看看是否能解决问题(失败了)。bug解决方案直接看最后。 开发环境OS X 10.....
分类:
其他好文 时间:
2014-09-02 14:08:24
阅读次数:
235
1.Language Architecture 2.User Interface Elements That Consume User ResourcesThe SharePoint Foundation object model has six classes that have propert....
分类:
其他好文 时间:
2014-09-02 14:01:54
阅读次数:
371
LeetCode: SubsetsGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The soluti...
分类:
其他好文 时间:
2014-08-31 22:53:32
阅读次数:
250
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the n...
分类:
其他好文 时间:
2014-08-31 17:20:11
阅读次数:
271
Spiral Matrix
Total Accepted: 12721 Total
Submissions: 62094My Submissions
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For ex...
分类:
其他好文 时间:
2014-08-31 17:19:01
阅读次数:
210
Spiral Matrix II
Total Accepted: 12773 Total
Submissions: 41526My Submissions
Given an integer n, generate a square matrix filled with elements from 1 to n2 in
spiral order.
For exampl...
分类:
其他好文 时间:
2014-08-31 17:17:11
阅读次数:
128
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:
其他好文 时间:
2014-08-30 01:10:48
阅读次数:
333