- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 Android RecyclerView源码学习
RecyclerView 的三驾马车LayoutManager掌管RecyclerView的布局,你可以通过它实现一个listview、gridview、瀑布流等效果。LayoutManager主要作用与RecyclerView的measure和layout过程中。LayoutManager是RecyclerView中的一个内部抽象类,具体实现类有GridLayoutManager,LinearLa
2017-02-24 13:40:51 630
原创 [Leetcode] Split Array Largest Sum
Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m suba
2017-02-23 15:25:15 531
原创 KMP的两种写法
KMP算法可以用来匹配模式字符串,或者寻找最小重复单元,比如abcabcabc,最小重复单元就是abc。qweqweqwe,最小重复单元是qwe。寻找最小重复单元就是计算出字符串的最长公共前缀的长度a,如果 a != 0 && len %(len-a) == 0即找到最小重复单元。详细内容见KMP算法 核心在于next数组的计算,因此列出getNext的不同计算方法。1、next[i]表示长度为i
2017-02-12 01:09:39 1081 1
原创 [LeetCode] Max Sum of Rectangle No Larger Than K
题目 Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. Example: Given matrix = [ [1, 0, 1], [0,
2017-02-09 23:50:43 453
原创 [LeetCode] Reconstruct Itinerary
题目 Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from JFK. Thus
2017-02-07 23:37:07 444
原创 [LeetCode] Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], t
2017-02-06 01:01:02 305
原创 [LeetCode] Patching Array
题目 Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array.
2017-02-01 23:53:40 282
悬浮窗口及菜单demo
2017-01-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人