2016年4月7日

InputStream源码分析

摘要: InputStream是一个抽象类,属于字节流的读取。 阅读全文

posted @ 2016-04-07 16:54 olive_lv 阅读(1583) 评论(0) 推荐(0)

2016年3月22日

338. Counting Bits

摘要: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文

posted @ 2016-03-22 11:35 olive_lv 阅读(441) 评论(1) 推荐(0)

2016年3月16日

145. Binary Tree Postorder Traversal

摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. 解题思路: 方法 阅读全文

posted @ 2016-03-16 21:41 olive_lv 阅读(200) 评论(0) 推荐(0)

2016年3月15日

153. Find Minimum in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.     (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).     Find the minimum 阅读全文

posted @ 2016-03-15 21:34 olive_lv 阅读(125) 评论(0) 推荐(0)

89. Gray Code

摘要: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文

posted @ 2016-03-15 21:34 olive_lv 阅读(110) 评论(0) 推荐(0)

62. Unique Paths

摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).     The robot can only move either down or right at a 阅读全文

posted @ 2016-03-15 21:33 olive_lv 阅读(101) 评论(0) 推荐(0)

202. Happy Number

摘要: Write an algorithm to determine if a number is "happy".     A happy number is a number defined by the following process: Starting with any positive in 阅读全文

posted @ 2016-03-15 10:12 olive_lv 阅读(204) 评论(0) 推荐(0)

2016年3月11日

53. Maximum Subarray

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2, 阅读全文

posted @ 2016-03-11 11:13 olive_lv 阅读(152) 评论(0) 推荐(0)

70. 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 cl 阅读全文

posted @ 2016-03-11 11:13 olive_lv 阅读(125) 评论(0) 推荐(0)

263. Ugly Number

摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文

posted @ 2016-03-11 11:12 olive_lv 阅读(111) 评论(0) 推荐(0)

导航