
链表
文章平均质量分 64
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 · 257 阅读 · 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 · 311 阅读 · 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 · 254 阅读 · 0 评论