- 博客(20)
- 资源 (2)
- 收藏
- 关注
原创 算法概论 8.8习题证明
问题 STINGY SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variables are true, if such an assignm
2017-07-02 18:47:34 165
原创 LeetCode 101. Symmetric Tree
Description Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \
2017-06-22 16:42:08 162
原创 LeetCode 100. Same Tree
Description Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
2017-06-18 16:38:38 167
原创 LeetCode 357. Count Numbers with Unique Digits
Description Given a non-negative integer n, count all numbers with unique digits, x, where 0≤x<10n0 ≤ x < 10^{n}. Example: Given n = 2, return 91. (The answer should be the total numbers in the
2017-06-11 22:05:18 134
原创 LeetCode 9. Palindrome Number
Description Determine whether an integer is a palindrome. Do this without extra space. Hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer t
2017-06-04 22:35:11 153
原创 LeetCode 561. Array Partition I
DescriptionGiven an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large
2017-05-28 16:11:12 283
原创 LeetCode 167. Two Sum II - Input array is sorted
DescriptionGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two
2017-05-21 23:41:44 120
原创 LeetCode 123. Best Time to Buy and Sell Stock III
Description Say you have an array for which the ithi^{th} element is the price of a given stock on day ii. Design an algorithm to find the maximum profit. You may complete at most two transactions
2017-05-08 21:33:59 168
原创 LeetCode 122. Best Time to Buy and Sell Stock II
Description Say you have an array for which the ithi^{th} element is the price of a given stock on day ii. Design an algorithm to find the maximum profit. You may complete as many transactions as
2017-05-07 22:49:08 144
原创 LeetCode 121. Best Time to Buy and Sell Stock
Description Say you have an array for which the ithi^{th} element is the price of a given stock on day ii. If you were only permitted to complete at most one transaction (ie, buy one and sell one
2017-04-30 22:00:57 143
原创 LeetCode 338. Counting Bits
Description 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-04-23 23:33:05 107
原创 LeetCode 413. Arithmetic Slices
Description A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arith
2017-04-16 19:44:02 119
原创 LeetCode 406. Queue Reconstruction by Height
Description Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in f
2017-04-09 22:33:11 118 1
原创 LeetCode 452. Minimum Number of Arrows to Burst Balloons
Description There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizont
2017-04-03 13:03:20 160
原创 LeetCode 94. Binary Tree Inorder Traversal
Description Given a binary tree, return the inorder traversal of its nodes’ values. For example: Given binary tree[1,null,2,3], 1 \ 2 / 3 return [1,3,2].Solution思路:题意
2017-03-26 22:24:01 118
原创 LeetCode 98. Validate Binary Search Tree
Description Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than
2017-03-18 21:14:57 130
原创 LeetCode 215. Kth Largest Element in an Array
Description Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Given[3,2,1,5,6,4] and k =
2017-03-12 20:54:21 106
原创 LeetCode 241. Different Ways to Add Parentheses
Description Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Exam
2017-03-05 16:38:08 213
转载 欢迎使用CSDN-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2017-02-22 09:44:03 142
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人