![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Algorithms
Das-Boot
这个作者很懒,什么都没留下…
展开
-
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 · 218 阅读 · 0 评论 -
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 · 167 阅读 · 0 评论 -
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 · 173 阅读 · 0 评论 -
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 · 123 阅读 · 0 评论 -
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 · 148 阅读 · 0 评论 -
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 · 172 阅读 · 0 评论 -
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 · 154 阅读 · 0 评论 -
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 · 287 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 · 121 阅读 · 0 评论 -
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 · 146 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 · 121 阅读 · 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 · 162 阅读 · 0 评论 -
LeetCode 1. Two Sum
1. Two Sum原创 2017-02-26 21:23:49 · 136 阅读 · 0 评论 -
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 · 110 阅读 · 0 评论 -
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 · 133 阅读 · 0 评论 -
算法概论 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 · 170 阅读 · 0 评论