deno.land / x / masx200_leetcode_test@10.6.5 / design-skiplist / Skiplist_test.go

Skiplist_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package index
import "testing"import "gotest.tools/v3/assert"
func TestSkiplist(t *testing.T) { skiplist := Constructor() skiplist.Add(1) skiplist.Add(2) skiplist.Add(3) assert.Equal(t, false, skiplist.Search(0)) // 返回 false skiplist.Add(4) assert.Equal(t, true, skiplist.Search(1)) // 返回 true assert.Equal(t, false, skiplist.Erase(0)) // 返回 false,0 不在跳表中 assert.Equal(t, true, skiplist.Erase(1)) // 返回 true assert.Equal(t, false, skiplist.Search(1)) // 返回 false,1 已被擦除
}
masx200_leetcode_test
leetcode题解和一些测试工具
DocumentationDocumentation
GitHub Repositorymasx200/leetcode-test
GitHub Stars
4

Version Info

Tagged at
4 months ago