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

Commit 77cda35

Browse files
author
openset
committed
Add: test case
1 parent 302bb96 commit 77cda35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎problems/design-linked-list/design_linked_list_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ func TestConstructor(t *testing.T) {
1010
output := obj.Get(1) == 2 // returns 2
1111
obj.DeleteAtIndex(1) // now the linked list is 1->3
1212
output = obj.Get(1) == 3 && output
13+
obj.AddAtIndex(2, 2) // linked list becomes 1->3->2
14+
output = obj.Get(5) == -1 && output
1315
if !output {
1416
t.Fatalf("output: %v, expected: %v", output, true)
1517
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /