添加(链表理论基础.md):增加JS和TS版本

This commit is contained in:
Steve2020
2022-01-08 23:55:34 +08:00
parent b10a6f5883
commit cb0f5906fd

View File

@ -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 Python