2014年10月20日
摘要: problem: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra sp... 阅读全文
posted @ 2014-10-20 21:03 higerzhang 阅读(209) 评论(0) 推荐(0) 编辑
摘要: problem:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doe... 阅读全文
posted @ 2014-10-20 17:50 higerzhang 阅读(253) 评论(0) 推荐(0) 编辑
摘要: problem:Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthe... 阅读全文
posted @ 2014-10-20 17:18 higerzhang 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Problem: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.Yo... 阅读全文
posted @ 2014-10-20 12:08 higerzhang 阅读(317) 评论(0) 推荐(0) 编辑
摘要: problem:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.先合并两个list,再根据归并排序的方法递归合并。假设总共有k个list,每个list的最大... 阅读全文
posted @ 2014-10-20 00:56 higerzhang 阅读(154) 评论(0) 推荐(0) 编辑