发布时间:2015-04-13 14:26:42
//Divide Two Integers Total Accepted: 34192 Total Submissions: 223949 My Submissions Question Solution //Divide two integers without using multiplication, division and mod operator.////If it is overflow, return MAX_INT.下面时申请动态数组来存 divisor*2^i的值,以便来与dividend进行比较来确定.........【阅读全文】
发布时间:2015-04-09 20:27:25
//Implement strStr() Total Accepted: 46286 Total Submissions: 209890 My Submissions Question Solution //Implement strStr().////Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.public class ImplementstrStr {public static void main(St.........【阅读全文】
发布时间:2015-04-09 11:21:42
//Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.////Do not allocate extra space for another array, you must do this in place with constant memory.////For example,//Given input array A = [1,1,2],////Your function should r.........【阅读全文】
发布时间:2015-04-09 11:08:58
//Reverse Nodes in k-Group Total Accepted: 29152 Total Submissions: 115092 My Submissions Question Solution //Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.////If the number of nodes is not a multiple of k then left-out nodes in the end shou.........【阅读全文】
发布时间:2015-04-08 15:14:58
//Swap Nodes in Pairs Total Accepted: 43260 Total Submissions: 133314 My Submissions Question Solution //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 algorithm should use only c.........【阅读全文】