LeetCode,leetcodeoj題目連結:First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant
Think in Java(八):持有對象,thinkjava1.各種map的區別HashMap: 沒有按照任何明顯的順序來儲存其元素(同HashSet)TreeMap:按照比較結果的升序儲存key(同TreeSet)LinkedHashMap:按照插入順序儲存key(同LinkedHashSet)2.ListIterator是一個更為強大的Iterator的子類型,Iterator只能向前移動,但是ListIterator可以雙向移動public class ListIteration
LeetCode,leetcodeoj題目連結:Trapping Rain WaterGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example,Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. ^
HDU 5172 GTY's gay friends(線段樹),hdugtyProblem DescriptionGTY has n gay friends. To manage them conveniently, every morning he ordered all his gay friends to stand in a line. Every gay friend has a characteristic value ai , to
leetcode 187: Repeated DNA Sequences,leetcoderepeatedTotal Accepted: 1161 Total Submissions: 6887All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes