mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-27 12:06:29 +08:00
18 lines
332 B
JavaScript
18 lines
332 B
JavaScript
|
/*
|
||
|
* File: ListNode.js
|
||
|
* Created Time: 2022-12-12
|
||
|
* Author: Justin (xiefahit@gmail.com)
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Definition for a singly-linked list node
|
||
|
*/
|
||
|
class ListNode {
|
||
|
constructor(val, next) {
|
||
|
this.val = val === undefined ? 0 : val;
|
||
|
this.next = next === undefined ? null : next;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = ListNode;
|