mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
添加(链表理论基础.md):增加JS和TS版本
This commit is contained in:
@ -168,6 +168,32 @@ public class ListNode {
|
||||
}
|
||||
```
|
||||
|
||||
JavaScript:
|
||||
|
||||
```javascript
|
||||
class ListNode {
|
||||
val;
|
||||
next = null;
|
||||
constructor(value) {
|
||||
this.val = value;
|
||||
this.next = null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
TypeScript:
|
||||
|
||||
```typescript
|
||||
class ListNode {
|
||||
public val: number;
|
||||
public next: ListNode = null;
|
||||
constructor(value: number) {
|
||||
this.val = value;
|
||||
this.next = null;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Python:
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user