摘要:
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... 阅读全文
摘要:
Question:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Analysis:只想到了,首先判断是否有环,若有环,则总链首开始,一次判断是否是环的开始,这... 阅读全文
摘要:
Question:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Analysis:思路一:快慢指针法。前面用到过快慢指针寻找链表的... 阅读全文
摘要:
Question:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Analysis:合并k个排好序的链表,返回最终一个总的排序列表。分析并描述他的复杂度。l... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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. ... 阅读全文
摘要:
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)的时间和... 阅读全文
摘要:
相似题目:Palindrome NumberValid PalinDromeReverseLinked ListPalindrome Linked ListQuestion:Determine whether an integer is a palindrome. Do this without e... 阅读全文