08 2016 档案

摘要:Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. KMP算法,很久没写了,这个题目正好复习一下 K 阅读全文
posted @ 2016-08-24 12:31 sfeiqiang 阅读(150) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-08-23 12:21 sfeiqiang 阅读(265) 评论(0) 推荐(0)
摘要:Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num = 5, return f 阅读全文
posted @ 2016-08-21 13:13 sfeiqiang 阅读(112) 评论(0) 推荐(0)
摘要:Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your 阅读全文
posted @ 2016-08-21 12:23 sfeiqiang 阅读(115) 评论(0) 推荐(0)
摘要:Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 不用递归和循环,这里有一 阅读全文
posted @ 2016-08-21 00:11 sfeiqiang 阅读(152) 评论(0) 推荐(0)
摘要:4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The 阅读全文
posted @ 2016-08-14 12:53 sfeiqiang 阅读(216) 评论(0) 推荐(0)