Files
hello-algo/ja/codes/dart/utils/list_node.dart
Yudong Jin 7257641e0e Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese

* Fit Japanese homepage labels and localize heading permalinks

* Point Japanese contribution instructions to the Japanese preview

* Replace locale conditionals with multilingual UI tables
2026-10-30 02:12:26 +08:00

25 lines
505 B
Dart

/**
* File: list_node.dart
* Created Time: 2023-01-23
* Author: Jefferson (JeffersonHuang77@gmail.com)
*/
/* 連結リストのノード */
class ListNode {
int val;
ListNode? next;
ListNode(this.val, [this.next]);
}
/* リストをデシリアライズして連結リストにする */
ListNode? listToLinkedList(List<int> list) {
ListNode dum = ListNode(0);
ListNode? head = dum;
for (int val in list) {
head?.next = ListNode(val);
head = head?.next;
}
return dum.next;
}