摘要: 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 阅读全文
posted @ 2018-01-08 19:00 SYSU_Bango 阅读(149) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-14 14:31 SYSU_Bango 阅读(149) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-11 22:09 SYSU_Bango 阅读(150) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-11 12:53 SYSU_Bango 阅读(169) 评论(0) 推荐(0)
摘要: Decription: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 解题思路: 分别从a和b字符串的最后一位开始遍历,用char 阅读全文
posted @ 2017-12-06 19:08 SYSU_Bango 阅读(126) 评论(0) 推荐(0)
摘要: Description: Implement pow(x, n). Example 1: Example 2: 解法二: 一开始用迭代法实现,一直超时,我真的要疯了- -,优化了很久。 INT_MAX = 2147483647而INT_MIN = -2147483648。所以,x的INT_MIN次幂 阅读全文
posted @ 2017-12-05 20:10 SYSU_Bango 阅读(153) 评论(0) 推荐(0)
摘要: 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: 解 阅读全文
posted @ 2017-12-05 19:36 SYSU_Bango 阅读(244) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-04 00:18 SYSU_Bango 阅读(102) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-03 23:53 SYSU_Bango 阅读(89) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2017-12-03 23:06 SYSU_Bango 阅读(177) 评论(0) 推荐(0)