上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要: Question: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should pre 阅读全文
posted @ 2018-02-26 11:04 于淼 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Question: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a 阅读全文
posted @ 2018-02-26 09:39 于淼 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Question: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, 阅读全文
posted @ 2018-02-25 19:09 于淼 阅读(72) 评论(0) 推荐(0) 编辑
摘要: Question: 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- 阅读全文
posted @ 2018-02-25 10:27 于淼 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Question: Sort a linked list in O(n log n) time using constant space complexity. Tips:给一个单链表按照val进行排序。 思路:题目要求时间复杂度为nlog(n) 这是归并排序的时间复杂度,即采用分治的方法进行排序。 阅读全文
posted @ 2018-02-24 12:05 于淼 阅读(108) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2018-02-24 00:33 于淼 阅读(112) 评论(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 @ 2018-02-22 21:44 于淼 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 阅读全文
posted @ 2018-02-20 17:17 于淼 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Given a linked list, determine if it ha 阅读全文
posted @ 2018-02-20 09:47 于淼 阅读(94) 评论(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 @ 2018-02-14 23:21 于淼 阅读(71) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页