Skip to content

Commit a60d4dc

Browse files
committed
add SplayTree to docs
1 parent 8fdf15a commit a60d4dc

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This package implements a variety of data structures, including
3333
- DiBitVector (in which each element can store two bits)
3434
- Red Black Tree
3535
- AVL Tree
36+
- Splay Tree
3637

3738
Resources
3839
---------

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ makedocs(
2828
"dibit_vector.md",
2929
"red_black_tree.md",
3030
"avl_tree.md",
31+
"splay_tree.md",
3132
],
3233
modules = [DataStructures],
3334
format = Documenter.HTML()

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This package implements a variety of data structures, including
2525
- DiBitVector
2626
- Red Black Tree
2727
- AVL Tree
28+
- Splay Tree
2829

2930
## Contents
3031

src/splay_tree.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function Base.push!(tree::SplayTree{K}, key0) where K
216216
end
217217

218218
function Base.getindex(tree::SplayTree{K}, ind) where K
219-
@boundscheck (1 <= ind <= tree.count) || throw(BoundsError("$ind should be in between 1 and $(tree.count)"))
219+
@boundscheck (1 <= ind <= tree.count) || throw(KeyError("$ind should be in between 1 and $(tree.count)"))
220220
function traverse_tree_inorder(node::SplayTreeNode_or_null)
221221
if (node != nothing)
222222
left = traverse_tree_inorder(node.leftChild)

test/test_splay_tree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
for i in 1:10
106106
@test t6[i] == i
107107
end
108-
@test_throws BoundsError getindex(t6, 0)
109-
@test_throws BoundsError getindex(t6, 11)
108+
@test_throws KeyError getindex(t6, 0)
109+
@test_throws KeyError getindex(t6, 11)
110110
end
111111

112112
@testset "key conversion in push!" begin

0 commit comments

Comments
 (0)