Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb43eeff

Browse files
author
Kohei Asai
authored
Format linked list (#137)
1 parent85b71dc commitb43eeff

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

‎data_structures/linked_list.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ export interface LinkedListNode<T> {
33
next:LinkedListNode<T>|null;
44
}
55

6-
exportfunctioncreateLinkedListNode<T>(
7-
array:T[]
8-
):LinkedListNode<T>|null{
6+
exportfunctioncreateLinkedListNode<T>(array:T[]):LinkedListNode<T>|null{
97
if(array.length===0)returnnull;
108

119
consthead:LinkedListNode<T>={val:array[0],next:null};

‎data_structures/linked_list_test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ test("getNthNode(node, n) throws a TypeError if the given index is not an intege
8989
TypeError
9090
);
9191
assertThrows(
92-
()=>
93-
getNthNode(createLinkedListNode([0,1,2,3,4,5])!,-Infinity),
92+
()=>getNthNode(createLinkedListNode([0,1,2,3,4,5])!,-Infinity),
9493
TypeError
9594
);
9695
assertThrows(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp