原创 java源碼學習----ArrayList

ArrayList源碼分析 類的繼承關係 ArrayList的默認大小爲10 ArrayList的底層實現 構造函數 1 無參構造函數 2 指定大小的構造函數 3 利用集合構造 常用函數 1 size求大小 2 isEmp

原创 [Leetcode] 436. Find Right Interval

leetcode題目 題意:給定一組區間,求給定區間 在這些區間中 在給定區間右側,且與給定區間距離最近區間的位置。 思路: 把給定區間的右邊界與這些區間中的左邊界進行比較,選擇出,左邊界比給定區間右邊界大,且距給定區間最近區

原创 [leetcode] 107. Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, leve

原创 [leetcode] 101. Symmetric Tree

題目: leetcode 鏈接 思路:分別判斷對稱位置的值是否相同,即根節點的左子樹的左節點和右子樹的右節點 與 左子樹的右節點和右子樹的左節點是否都相同。並依次按左子樹的左節點和右子樹的右節點 左子樹的右節點和右子樹的左節

原创 [Leetcode] 319. Bulb Switcher

題目: There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bu

原创 [Leetcode] 60. Permutation Sequence

題目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutation

原创 [Leetcode] 226. Invert Binary Tree

題目: Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \

原创 [leetcode] 198. House Robber

題目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money

原创 [Leetcode] 350. Intersection of Two Arrays II

題目: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2

原创 [Leetcode] 49. Group Anagrams

題目: 鏈接 Group Anagrams Given an array of strings, group anagrams together. For example, given: [“eat”, “tea”, “tan

原创 [leetcode] 121. Best Time to Buy and Sell Stock

題目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permi

原创 Collection 集合大家族

轉載來自 http://www.cnblogs.com/chenssy/p/3495238.html java集合大家族 一Collection接口 二List接口 1ArrayList 2LinkedList 3Vect

原创 [leetcode] 96. Unique Binary Search Trees

題目: Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n

原创 [leetcode] 376. Wiggle Subsequence

題目: A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly altern

原创 [leetcode] 122. Best Time to Buy and Sell Stock II

題目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to