更新 0707.设计链表 排版格式修复

This commit is contained in:
jinbudaily
2023-07-18 14:41:02 +08:00
parent a78116889f
commit 61366ff590
2 changed files with 19 additions and 19 deletions

View File

@ -88,9 +88,6 @@
最后呢在题目中return 头结点的时候,别忘了 `return dummyNode->next;` 这才是新的头结点
### C++代码
**直接使用原来的链表来进行移除节点操作:**
```CPP
@ -638,3 +635,4 @@ public class Solution
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

View File

@ -25,12 +25,12 @@
![707示例](https://code-thinking-1253855093.file.myqcloud.com/pics/20200814200558953.png)
# 算法公开课
## 算法公开课
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[帮你把链表操作学个通透LeetCode707.设计链表](https://www.bilibili.com/video/BV1FU4y1X7WD),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
# 思路
## 思路
如果对链表的基础知识还不太懂,可以看这篇文章:[关于链表,你该了解这些!](https://programmercarl.com/链表理论基础.html)
@ -58,8 +58,6 @@
下面采用的设置一个虚拟头结点(这样更方便一些,大家看代码就会感受出来)。
## 代码
```CPP
class MyLinkedList {
public:
@ -167,7 +165,8 @@ private:
## 其他语言版本
C:
### C:
```C
typedef struct MyLinkedList {
int val;
@ -291,7 +290,8 @@ void myLinkedListFree(MyLinkedList* obj) {
*/
```
Java
### Java
```Java
//单链表
class ListNode {
@ -487,7 +487,8 @@ class MyLinkedList {
*/
```
Python
### Python
```python
版本一单链表法
class ListNode:
@ -661,7 +662,7 @@ class MyLinkedList:
# obj.deleteAtIndex(index)
```
Go
### Go
```go
//单链表实现
@ -915,7 +916,7 @@ func (this *MyLinkedList) DeleteAtIndex(index int) {
}
```
javaScript:
### JavaScript:
```js
@ -1055,7 +1056,8 @@ MyLinkedList.prototype.deleteAtIndex = function(index) {
*/
```
TypeScript:
### TypeScript:
```TypeScript
class ListNode {
public val: number;
@ -1173,7 +1175,8 @@ class MyLinkedList {
}
```
Kotlin:
### Kotlin:
```kotlin
class MyLinkedList {
@ -1241,8 +1244,7 @@ class MyLinkedList {
}
```
Swift:
### Swift:
```swift
class MyLinkedList {
@ -1323,7 +1325,8 @@ class MyLinkedList {
}
```
Scala:
### Scala:
```scala
class ListNode(_x: Int = 0, _next: ListNode = null) {
var next: ListNode = _next
@ -1393,7 +1396,7 @@ class MyLinkedList() {
}
```
Rust:
### Rust:
```rust
#[derive(Debug)]
@ -1486,4 +1489,3 @@ impl MyLinkedList {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>