- 博客(11)
- 收藏
- 关注
转载 [leetcode] 222. Count Complete Tree Nodes
Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled,
2016-09-05 11:53:43 306
转载 [leetcode] 332. 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
2016-09-05 11:00:15 337
转载 [leetcode] 139. Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = "leetcode", dict = ["leet"
2016-09-05 06:16:50 321
转载 [leetcode] 306. Additive Number
Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the
2016-09-05 05:52:39 286
转载 [leetcode] 229. Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. Hint: How many majority elements could it po
2016-09-04 05:27:23 265
转载 [leetcode] 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible
2016-09-03 07:52:54 185
转载 [leetcode] Implement pow(x, n). Subscribe to see which companies asked this question
Implement pow(x, n). 要注意n class Solution { public: double myPow(double x, int n) { if(n<0) return 1/power(x,-n); else return power(x,n); } double power(double
2016-09-03 07:32:07 338
转载 [leetcode] 187. Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA. Wri
2016-09-03 06:28:27 193
转载 [leetcode] 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1-
2016-09-03 05:56:31 257
转载 [leetcode] 373. Find K Pairs with Smallest Sums
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from the first array and one element from the second
2016-09-01 11:15:55 214
转载 [leetcode] 310. Minimum Height Trees
For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called mini
2016-09-01 10:27:12 187
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人