上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页
摘要: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 1 阅读全文
posted @ 2017-12-10 05:20 Jimmy_Cheng 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length of each 阅读全文
posted @ 2017-12-08 11:37 Jimmy_Cheng 阅读(475) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2017-12-05 11:56 Jimmy_Cheng 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 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? 题目标签:Linked List 题目给了我们一个 linked l 阅读全文
posted @ 2017-12-02 11:30 Jimmy_Cheng 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. 题目标签:Linked List 题目给了我们一个链表,要求我们倒转链表。 利用递归,新设一个newHead = null,每一轮 把下一个 node 存入 next 记住,把目前的点 cursor 连到 newHead; 然后把 next 阅读全文
posted @ 2017-11-30 08:09 Jimmy_Cheng 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
posted @ 2017-11-30 05:49 Jimmy_Cheng 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2017-11-30 05:14 Jimmy_Cheng 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 题目标签:Linked List 题目给了我们一个 Linked List,让我 阅读全文
posted @ 2017-11-23 08:12 Jimmy_Cheng 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2017-11-23 07:55 Jimmy_Cheng 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 题目标签:Lin 阅读全文
posted @ 2017-11-23 07:14 Jimmy_Cheng 阅读(363) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 27 下一页