Skip to content

Commit b43eeff

Browse files
author
Kohei Asai
authored
Format linked list (axross#137)
1 parent 85b71dc commit b43eeff

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Diff for: data_structures/linked_list.ts

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

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

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

Diff for: data_structures/linked_list_test.ts

+1-2
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)