题目 To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the sam ...
分类:
其他好文 时间:
2020-05-28 19:53:14
阅读次数:
55
链接:https://leetcode-cn.com/problems/add-two-numbers/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * L ...
分类:
其他好文 时间:
2020-05-25 00:15:00
阅读次数:
65
链接:https://leetcode-cn.com/problems/sort-list/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNod ...
分类:
编程语言 时间:
2020-05-24 23:59:47
阅读次数:
102
链接:https://leetcode-cn.com/problems/reverse-linked-list/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; ...
分类:
其他好文 时间:
2020-05-24 23:53:03
阅读次数:
71
链表 链表是一种单线联络的形式 单向链表的结构: data|next > data|next > data|next > data|next > .... > NULL 既然有单向列表,如果我快速地找到前面的节点,怎么办? 双向链表 NULL < prev|data|next > prev|data ...
分类:
编程语言 时间:
2020-05-24 16:35:50
阅读次数:
52
反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 用一个变量记录pre,一个变量记录next,不断更新current.next = pre 注意更新 cur 和 pre 的位置, 否则有可能出现溢出 python # Defin ...
分类:
其他好文 时间:
2020-05-24 12:12:42
阅读次数:
49
(1)List:有序,可重复。 ArrayList:底层实现的数据结构是数组,查询快,增删慢。线程不安全,效率高 LinkedList:底层实现的数据结构是链表,查询慢,增删块。线程不安全,效率高 Vector:底层实现的数据结构是数组,查绚块,增删慢。线程安全,效率低。 (2)Set:无序,唯一。 HashSet:底层数据结构是哈希表(无序,唯一)。保证元素唯一性依赖于
分类:
其他好文 时间:
2020-05-24 09:35:28
阅读次数:
72
https://www.learn-c.org/en/Linked_lists https://www.youtube.com/watch?v=VOpjAHCee7c used for dynamic data structure ...
分类:
其他好文 时间:
2020-05-24 09:21:24
阅读次数:
41
[TOC] 1. LeetCode Link (LeetCode 817. 链表组件)[https://leetcode cn.com/problems/linked list components/] 2. Tag 1. 链表 2. 3. Code ...
分类:
其他好文 时间:
2020-05-21 10:19:44
阅读次数:
62
[抄题]: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1, ...
分类:
其他好文 时间:
2020-05-21 00:30:28
阅读次数:
49