自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 课本8.19 kite问题的NP完全问题证明

题目描述:A kite is a graph on an even number of vertices, say 2n, in which n of the vertices form a clique and the remaining n vertices are connected in a “tail” that consists of a path joined to one

2017-07-16 21:38:47 522

原创 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 return them as an array.Example:

2017-06-11 17:32:02 193

原创 64. Minimum Path Sum

题目描述:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down

2017-06-04 23:30:41 157

原创 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 = 3, there are a total of 5 unique BST's. 1 3 3 2

2017-05-30 00:13:57 172

原创 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 climb to the top?Note: Given n wil

2017-05-20 12:01:57 178

原创 303. Range Sum Query - Immutable

题目描述:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -

2017-05-13 23:42:51 140

原创 198. House Robber

题目描述:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adj

2017-05-07 21:22:23 131

原创 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 permitted to complete at most one transaction (ie, buy one and sell one share of

2017-04-26 22:47:59 136

原创 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 find the maximum profit. You may complete as many transactions as you like

2017-04-23 17:38:01 135

原创 455. Assign Cookies

题目描述:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum

2017-04-16 16:58:42 126

原创 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, level by level from leaf to root).For example:Given binary tree [3,9,20,

2017-04-08 22:21:54 148

原创 111. Minimum Depth of Binary Tree

题目描述:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.解题思路:本题用BFS的算法,同时向左右子结点

2017-04-01 23:55:11 130

原创 112. Path Sum

题目描述:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tr

2017-03-26 18:58:37 126

原创 399. Evaluate Division

题目描述:Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers.

2017-03-20 13:14:40 150

原创 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,1,-5,4],the contiguous subarray [4

2017-03-12 22:57:38 234

原创 169. Majority Element

题目描述:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majori

2017-03-05 20:53:20 130

原创 485. Max Consecutive Ones

题目描述:Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are c

2017-02-26 11:26:11 161

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除