Skip to content

Commit 8295c4a

Browse files
committed
add SplayTree to docs
1 parent 684b41f commit 8295c4a

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
@@ -31,6 +31,7 @@ This package implements a variety of data structures, including
3131
- SparseIntSet
3232
- DiBitVector (in which each element can store two bits)
3333
- Red Black Tree
34+
- Splay Tree
3435

3536
Resources
3637
---------

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ makedocs(
2626
"sorted_containers.md",
2727
"dibit_vector.md",
2828
"red_black_tree.md",
29+
"splay_tree.md",
2930
],
3031
modules = [DataStructures],
3132
format = Documenter.HTML()

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This package implements a variety of data structures, including
2323
- SparseIntSet
2424
- DiBitVector
2525
- Red Black Tree
26+
- Splay Tree
2627

2728
## Contents
2829

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)