上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 40 下一页
摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Analyse: Similiar to merge sort algorithm. Reuse the c... 阅读全文
posted @ 2015-07-21 22:00 amazingzoe 阅读(128) 评论(0) 推荐(0)
摘要: Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great... 阅读全文
posted @ 2015-07-21 18:30 amazingzoe 阅读(132) 评论(0) 推荐(0)
摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文
posted @ 2015-07-21 17:17 amazingzoe 阅读(129) 评论(0) 推荐(0)
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-06-23 14:55 amazingzoe 阅读(121) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?分析:... 阅读全文
posted @ 2015-05-20 21:52 amazingzoe 阅读(137) 评论(0) 推荐(0)
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?分析:用map记录是否出现过。用时:60ms 1 /** 2 * Definiti... 阅读全文
posted @ 2015-05-20 21:38 amazingzoe 阅读(135) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-05-20 00:46 amazingzoe 阅读(209) 评论(0) 推荐(0)
摘要: Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.分析:首先... 阅读全文
posted @ 2015-05-18 18:57 amazingzoe 阅读(193) 评论(0) 推荐(0)
摘要: Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2015-05-18 18:10 amazingzoe 阅读(128) 评论(0) 推荐(0)
摘要: Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
posted @ 2015-05-18 15:33 amazingzoe 阅读(107) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 40 下一页