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) 编辑
  2014年10月19日
摘要: problem:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is... 阅读全文
posted @ 2014-10-19 23:46 higerzhang 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the ... 阅读全文
posted @ 2014-10-19 00:19 higerzhang 阅读(166) 评论(0) 推荐(0) 编辑
  2014年10月18日
摘要: Problem:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. ... 阅读全文
posted @ 2014-10-18 23:45 higerzhang 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the ... 阅读全文
posted @ 2014-10-18 23:26 higerzhang 阅读(161) 评论(0) 推荐(0) 编辑
  2014年10月17日
摘要: Problem:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the... 阅读全文
posted @ 2014-10-17 21:03 higerzhang 阅读(225) 评论(0) 推荐(0) 编辑