Repository navigation
2.1 链表基础 #69
utterances-bot
started this conversation in
Comments
Replies: 10 comments 3 replies
|
这里为什么要默认第一个节点值为0 |
0 replies
|
0 replies
|
捉虫:2.1第二段LinkedList写成了ListkedList |
0 replies
原文已更改,感谢指正哈~ |
0 replies
|
链表尾部删除元素的代码中,在if部分除了要判断self.head.next不是None外,是否还要判断self.head本身也不是None?也就是if not self.head or not self.head.next. 这样的话,只要self.head或者self.head.next中至少有一个为None,则会执行if语句输出'Error". |
1 reply
|
2.3求线性链表长度时应该不包含头节点,cur = self.head是不是要修改为cur = self.head.next? |
0 replies
|
在头部插入元素时的操作,好像与头节点的定义有冲突 |
1 reply
|
建议!:2.2 建立def create时最好说明一下这是在LinkedList类内的方法,不然初学者很容易迷惑为什么可以直接调用self.head |
0 replies
|
在链表初始化时创建一个 |
0 replies
|
在插入节点时,初始值count是不是应该设置为1? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2.1 链表基础
链表基础知识 # 1. 链表简介 # 1.1 链表定义 # 链表(Linked List):一种线性表数据结构。它使用一组任意的存储单元(可以是连续的,也可以是不连续的),来存储一组具有相同类型的数据。
简单来说,「链表」 是实现线性表的链式存储结
https://algo.itcharge.cn/02_linked_list/02_01_linked_list_basic/
All reactions