欢迎来到PJCK的博客

随笔分类 -  数据结构与算法----链表

摘要:Description Insert a node in a sorted linked list. Description Description Insert a node in a sorted linked list. Insert a node in a sorted linked lis 阅读全文
posted @ 2019-04-23 18:21 PJCK 阅读(116) 评论(0) 推荐(0)
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2019-04-14 13:07 PJCK 阅读(102) 评论(0) 推荐(0)
摘要:We are given head, the head node of a linked list containing unique integer values. We are also given the list G, a subset of the values in the linked 阅读全文
posted @ 2019-04-14 12:47 PJCK 阅读(149) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use 阅读全文
posted @ 2019-04-14 11:22 PJCK 阅读(189) 评论(0) 推荐(0)
摘要:Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. Follow up: Could you 阅读全文
posted @ 2019-04-14 11:17 PJCK 阅读(183) 评论(0) 推荐(0)
摘要:Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, only nodes itself may be ch 阅读全文
posted @ 2019-04-14 10:29 PJCK 阅读(249) 评论(0) 推荐(0)
摘要:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2019-04-14 09:59 PJCK 阅读(111) 评论(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 @ 2019-04-14 09:53 PJCK 阅读(138) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-04-14 09:44 PJCK 阅读(78) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 阅读全文
posted @ 2019-04-14 09:39 PJCK 阅读(101) 评论(0) 推荐(0)
摘要:Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 链表翻转题 可以用 阅读全文
posted @ 2019-04-14 09:33 PJCK 阅读(108) 评论(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. Example: 阅读全文
posted @ 2019-04-14 09:21 PJCK 阅读(169) 评论(0) 推荐(0)