Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 5.15 KB

readme.md

File metadata and controls

43 lines (37 loc) · 5.15 KB

Linked List

链接与顺序表比较

链表:

- 时间:每个item的读取时间复杂度为O(n),适合主要操作在修改的(删除、插入)
- 空间:动态分配,空间利用率略低(有指针域)

顺序表:

- 时间:随机存取,每个item的存取时间复杂度为O(1),适合大量存取操作
- 空间:静态分配,空间利用率100%(不考虑闲置节点)

代码文件说明

Problem Title Links
Insert Node at the end of a linked list Code | Test | HackRank
Insert Node at the begining of a linked list Code | Test | HackRank
Delete Node at a given position in a linked list Code | Test | HackRank | LeetCode #19
Delete Node in a Linked List Code | Test | LeetCode #237, (LeetCode #203)(https://leetcode.com/problems/remove-linked-list-elements/description/)
Reverse a linked list Code | Test | HackRank | LeetCode #206
Print elements of a linked list in reverse order as standard output Code | Test | HackRank
Switch a node with its next Code | Test | Problem
Compare two linked lists A and B Code | Test | HackRank
Merge two sorted lists A and B as one linked list Code | Test | HackRank | LeetCode #21
Get Nth element from the end in a linked list of integers Code | Test | HackRank
Get Nth element from the end in a linked list of integers Code | Test | HackRank
Get length Code | Test | Problem
Get Nth element Code | Test | Problem
Remove all duplicate elements from a sorted linked list Code | Test | HackRank | LeetCode #83
Detect a cycle in a linked list Code | Test | HackRank | LeetCode #141
Find merge point of two linked lists Code | Test | HackRank
Split to even & odd lists Code | Test | Problem
List intersection Code | Test | LeetCode #160
List difference Code | Test | Problem
Palindrome Linked List [LeetCode #234
Palindrome Linked List [LeetCode #234
Palindrome Linked List [LeetCode #234
Palindrome Linked List [LeetCode #234

习题来源