摘要:
Description: Show that the following problem is NP-complete. MAXIMUM COMMON SUBGRAPH Input: Tswo graphes G1=(V1,E1) and G2=(V2,E2); a budget b. Output 阅读全文
摘要:
Description: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct wa 阅读全文
摘要:
Description: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row 阅读全文
摘要:
Description: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If 阅读全文
摘要:
Decription: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 解题思路: 分别从a和b字符串的最后一位开始遍历,用char 阅读全文
摘要:
Description: Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example 1: Example 2: 解 阅读全文
摘要:
Description: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1 阅读全文
摘要:
Description: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough sp 阅读全文
摘要:
Description: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: E 阅读全文