- 博客(11)
- 收藏
- 关注
原创 8.15 证明最大公共子图为NP-完全问题
题目:证明如下问题是NP-完全的: 输入:两个图G1=(V1,E1)和G2=(V2,E2) 输出:两个节点集合V1’和V2'分别是V1和V2的子集,它们被移除后,将在两图中分别留下至少b个节点,且图的剩余部分完全一样解: 我们需要找到一个NP-完全问题规约到该问题上,从而证明出该问题是NP-完全的。我们选择团问题规约到该问题中。
2016-11-17 11:31:41
1657
原创 Frog Jump
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.Given a list of
2016-11-09 18:42:52
490
原创 Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1
2016-11-01 20:04:45
309
原创 Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order
2016-10-25 20:04:21
249
原创 Super Ugly Number
Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7, 8, 13,
2016-10-18 19:29:47
310
原创 Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm shoul
2016-10-11 21:08:54
338
原创 Count Numbers with Unique Digits
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x [11,22,33,44,
2016-10-11 20:53:44
303
原创 Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return[ ["a
2016-09-27 19:37:59
289
原创 Largest Number
Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be ve
2016-09-20 13:37:35
323
原创 Search in Rotated Sorted Array——Hard
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array retur
2016-09-13 20:18:11
309
原创 [LeetCode] Kth Largest Element in an Array (找出数组的第k大的元素)
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 = 2, return 5.
2016-09-04 16:36:09
566
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人