上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 30 下一页
摘要: Question: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 do... 阅读全文
posted @ 2015-09-14 17:01 江湖小妞 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Question:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Analysis:只想到了,首先判断是否有环,若有环,则总链首开始,一次判断是否是环的开始,这... 阅读全文
posted @ 2015-09-12 21:21 江湖小妞 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Question:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Analysis:思路一:快慢指针法。前面用到过快慢指针寻找链表的... 阅读全文
posted @ 2015-09-12 20:42 江湖小妞 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Question:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Analysis:合并k个排好序的链表,返回最终一个总的排序列表。分析并描述他的复杂度。l... 阅读全文
posted @ 2015-09-12 20:16 江湖小妞 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Question: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 ofkth... 阅读全文
posted @ 2015-09-12 13:27 江湖小妞 阅读(299) 评论(0) 推荐(0) 编辑
摘要: Question: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.Y... 阅读全文
posted @ 2015-09-12 11:17 江湖小妞 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Question:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain ... 阅读全文
posted @ 2015-09-09 21:21 江湖小妞 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Question: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 @ 2015-09-09 19:26 江湖小妞 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Question:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Analysis:给出一个链表,能否在O(n)的时间和... 阅读全文
posted @ 2015-09-09 15:13 江湖小妞 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 相似题目:Palindrome NumberValid PalinDromeReverseLinked ListPalindrome Linked ListQuestion:Determine whether an integer is a palindrome. Do this without e... 阅读全文
posted @ 2015-09-09 14:12 江湖小妞 阅读(146) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 30 下一页