摘要:
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. KMP算法,很久没写了,这个题目正好复习一下 K 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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? 不用递归和循环,这里有一 阅读全文
摘要:
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 阅读全文