- 博客(24)
- 资源 (3)
- 收藏
- 关注
原创 [LeetCode]Linked List Cycle II
题目描述 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 给定一个链表,返回圆环开始的节点。如果没有圆环,则返回nul
2014-05-30 17:07:50 573
原创 [LeetCode]Reverse Linked List II
题目描述 Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n
2014-05-29 17:55:09 622
原创 [LeetCode]Climbing Stairs
题目描述 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 解题思路
2014-05-28 16:38:20 565
原创 各类排序算法的Java实现
/** * 冒泡排序,效率 O(n2),稳定的排序 */ public static int[] BubbleSort(int[] A) { int temp; if (A.length <= 1) return A; for (int i = A.length - 1; i > 0; i--) { for (int j = 0; j < i; j++) {
2014-05-18 11:42:31 541
原创 [剑指Offer]二维数组中的查找
题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序,请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否有该整数。 解题思路 代码
2014-05-13 10:40:16 433
原创 [LeetCode]Set Matrix Zeroes
题目描述 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra space? A straight forward solution
2014-05-12 14:56:56 550
原创 [LeetCode]Remove Duplicates from Sorted List
题目描述 Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 给定一个已排序的链表,去除其中
2014-05-06 11:14:38 412
原创 [LeetCode]Sum Root to Leaf Numbers
题目描述 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. F
2014-05-03 20:55:41 527
Android学习之SlidingMenu实现(向右滑动)
2013-04-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人