![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
链表
文章平均质量分 73
back-to-back
忙忙碌碌终日,终于一事无成。
展开
-
LeetCode 之 Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 ↘原创 2015-11-30 20:07:03 · 222 阅读 · 0 评论 -
LeetCode 之 Remove Linked List Elements
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 --> 3 --> 4 --> 5 简单的链表操作: /** * Definit原创 2015-12-03 22:52:45 · 278 阅读 · 0 评论 -
LeetCode 之 Palindrome Linked List
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? 方法一: 反序存一个新的链,在遍历两个链,进行比较,代码如下: bool isPalindrome(ListNode* head) {原创 2015-12-05 22:06:19 · 220 阅读 · 0 评论