- 博客(20)
- 收藏
- 关注
原创 操作系统原理课后习题8.8
先进行判断,EXACT 4SAT属于NP。 然后将3SAT归约到EXACT 4ASAT就可以证明后者的NP完全性。 我们已经知道对于任意一个3SAT实例,如果某个子句中包含相同文字多次,那么可以去掉多余的,如果同时包含了某个变量的肯定及否定,那么可以将这个变量去掉,再在每个子句中添加一些没用的辅助变量,这样就可以将每个子句所包含的文字数目扩充到四个。 结果3SAT实例转换成了一个EX
2017-06-20 21:06:31 655
原创 算法设计与应用基础系列19
Palindrome Linked List Given a singly linked list, determine if it is a palindrome. class Solution { public: bool isPalindrome(ListNode* head) { if(head==NULL||head-
2017-06-16 23:08:25 135
原创 算法设计与应用基础系列18
Best Time to Buy and Sell Stock IV 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 compl
2017-06-15 23:51:53 151
原创 算法设计与应用基础系列17
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. No
2017-06-15 21:07:07 167
原创 算法设计与应用基础系列16
Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. Credits: Special thanks to @ts f
2017-06-15 18:43:28 212
原创 算法设计与应用基础系列15
Two Sum II - Input array is sorted Given 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
2017-06-15 16:45:46 146
原创 算法设计与应用基础系列14
Min Stack Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.pop() -- Removes the element on top of th
2017-06-15 14:28:52 164
原创 算法设计与应用基础系列13
152Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the con
2017-06-15 01:22:56 131
原创 算法设计与应用基础系列12
Evaluate Reverse Polish Notation Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another
2017-06-15 00:23:14 116
原创 算法设计与应用基础系列11
Word Break Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary
2017-06-14 23:30:38 148
原创 算法设计与应用基础系列10
103. Binary Tree Zigzag Level Order Traversal Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next l
2017-06-14 19:46:50 148
原创 算法设计与应用基础系列9
Combination Sum Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same rep
2017-06-14 14:19:18 196
原创 算法设计与应用基础系列8
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking
2017-06-14 13:47:52 180
原创 算法设计与应用基础系列7
Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Subscribe to see which companies asked this question.
2017-06-14 13:43:30 180
原创 算法设计与应用基础系列6
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
2017-06-10 22:42:19 172
原创 算法设计与应用基础系列5
168. Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26
2017-06-10 19:20:37 137
原创 算法设计与应用基础系列4
172. Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. Credits: Special thanks to @t
2017-06-10 19:16:54 181
原创 算法设计与应用基础系列3
118. Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,
2017-05-16 18:42:01 141
原创 算法设计与应用基础系列2
152. Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the
2017-05-16 18:41:09 136
原创 算法设计与应用基础系列1
Merge To Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 题解:要合并两个排序好的list。先创一个新的lis
2017-05-02 15:20:48 157
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人