原创 [LeetCode] 91. Decode Ways

[LeetCode] 91. Decode Ways A message containing letters from A-Z is being encoded to numbers using the following mappi

原创 [LeetCode] 95. Unique Binary Search Trees II & I

[LeetCode] 95. Unique Binary Search Trees II & I Given an integer n, generate all structurally unique BST’s (binary se

原创 [LeetCode] 86. Partition List

[LeetCode] 86. Partition List Given a linked list and a value x, partition it such that all nodes less than x come bef

原创 [LeetCode] 88. Merge Sorted Array

[LeetCode] 88. Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorte

原创 [LeetCode] 89. Gray Code

[LeetCode] 89. Gray Code The gray code is a binary numeral system where two successive values differ in only one bit.

原创 [LeetCode] 87. Scramble String

[LeetCode] 87. Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two non-e

原创 [LeetCode] 97. Interleaving String

[LeetCode] 97. Interleaving String Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For e

原创 [LeetCode] 84. Largest Rectangle in Histogram

[LeetCode] 84. Largest Rectangle in Histogram Given n non-negative integers representing the histogram’s bar height wh

原创 歡迎使用CSDN-markdown編輯器

吝嗇SAT問題 - NPC問題證明 吝嗇SAT問題是這樣描述的:給定一組子句(每個子句都是其中文字的析取)和整數k,求一個最多有k個變量爲true的滿足賦值——如果該賦值存在。證明吝嗇SAT是NP-完全問題. 證明: 首先我們知道SA

原创 [LeetCode] 85. Maximal Rectangle

[LeetCode] 85. Maximal Rectangle Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containi

原创 94. Binary Tree Inorder Traversal

[LeetCode] 94. Binary Tree Inorder Traversal Given a binary tree, return the inorder traversal of its nodes’ values. F

原创 [算法作業][LeetCode] 133. Clone Graph

[算法作業][LeetCode] 133. Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its

原创 [算法作業-動態規劃][LeetCode] 97. Interleaving String

[算法作業-動態規劃][LeetCode] 97. Interleaving String Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 an

原创 [算法作業][LeetCode] 50. Pow(x, n) -- 分治法

[算法作業][LeetCode] 50. Pow(x, n) – 分治法 Implement pow(x, n). 對於xn ,可以通過分治的方法,設n=2k : xn=xn/2∗xn/2∗xn%2 xn/2=xn/4∗xn/4∗

原创 [LeetCode] 115. Distinct Subsequences

[LeetCode] 115. Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences of T