上一页 1 2 3 4 5 6 7 ··· 28 下一页
摘要: Source Sort a linked list in O(n log n) time using constant space complexity. 题解1 - 归并排序(链表长度求中间节点) 链表的排序操作,对于常用的排序算法,能达到 O(nlogn) 的复杂度有快速排序(平均情况)、归并排 阅读全文
posted @ 2022-11-12 22:24 凌雨尘 阅读(51) 评论(0) 推荐(0) 编辑
摘要: Source A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or nul 阅读全文
posted @ 2022-10-16 11:51 凌雨尘 阅读(23) 评论(0) 推荐(0) 编辑
摘要: Source Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' val 阅读全文
posted @ 2022-09-11 22:01 凌雨尘 阅读(36) 评论(0) 推荐(0) 编辑
摘要: Source You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linke 阅读全文
posted @ 2022-08-13 22:39 凌雨尘 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Source 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. E 阅读全文
posted @ 2022-08-07 14:43 凌雨尘 阅读(24) 评论(0) 推荐(0) 编辑
摘要: Source Problem Reverse a linked list from position m to n. Example Given 1->2->3->4->5->NULL, m = 2 and n = 4, return1->4->3->2->5->NULL. Note Given m 阅读全文
posted @ 2022-07-30 23:55 凌雨尘 阅读(29) 评论(0) 推荐(0) 编辑
摘要: Source Reverse a linked list. Example For linked list 1->2->3, the reversed linked list is 3->2->1 Challenge Reverse it in-place and in one-pass 题解1 - 阅读全文
posted @ 2022-07-03 13:36 凌雨尘 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Source Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Example Given 21->10->4->5, tail connects to no 阅读全文
posted @ 2022-06-12 15:04 凌雨尘 阅读(22) 评论(0) 推荐(0) 编辑
摘要: Source Given a linked list, determine if it has a cycle in it. Example Given 21->10->4->5, tail connects to node index 1, return true Challenge Follow 阅读全文
posted @ 2022-05-08 13:28 凌雨尘 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Source Given a linked list, remove the nth node from the end of list and return its head. Note The minimum number of nodes in list is n. Example Given 阅读全文
posted @ 2022-04-04 19:23 凌雨尘 阅读(23) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 28 下一页