Skip to content

Commit cf773ac

Browse files
authored
Rename the package (#5)
1 parent faf6f93 commit cf773ac

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "TreeDataStructures"
1+
name = "BinaryTrees"
22
uuid = "289e92be-c05a-437b-9e67-5b0c799891f8"
33
authors = ["Elias Carvalho <[email protected]> and contributors"]
44
version = "0.1.0"

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# TreeDataStructures.jl
1+
# BinaryTrees.jl
22

3-
[![Build Status](https://github.com/eliascarv/TreeDataStructures.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/eliascarv/TreeDataStructures.jl/actions/workflows/CI.yml?query=branch%3Amain)
4-
[![Coverage](https://codecov.io/gh/eliascarv/TreeDataStructures.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/eliascarv/TreeDataStructures.jl)
3+
[![Build Status](https://github.com/eliascarv/BinaryTrees.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/eliascarv/BinaryTrees.jl/actions/workflows/CI.yml?query=branch%3Amain)
4+
[![Coverage](https://codecov.io/gh/eliascarv/BinaryTrees.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/eliascarv/BinaryTrees.jl)
55

66
## Overview
77

8-
This package provides a collection of tree data structures implemented in Julia.
8+
This package provides a collection of binary trees implemented in Julia.
99

10-
Currently, it includes the following tree data structures:
10+
Currently, it includes the following binary trees:
1111
* **AVL Tree**: A self-balancing binary search tree.
1212

1313
## Installation
1414

15-
To install TreeDataStructures.jl, use the Julia's package manager:
15+
To install BinaryTrees.jl, use the Julia's package manager:
1616

1717
```
18-
] add https://github.com/eliascarv/TreeDataStructures.jl
18+
] add https://github.com/eliascarv/BinaryTrees.jl
1919
```
2020

2121
## AVL Tree

src/TreeDataStructures.jl renamed to src/BinaryTrees.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module TreeDataStructures
1+
module BinaryTrees
22

33
import AbstractTrees
44

src/avl.jl

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ function AbstractTrees.children(node::AVLNode)
2727
end
2828
end
2929

30-
AbstractTrees.nodevalue(node::AVLNode) = node.value
31-
3230
AbstractTrees.NodeType(::Type{<:AVLNode}) = AbstractTrees.HasNodeType()
3331
AbstractTrees.nodetype(T::Type{<:AVLNode}) = T
3432

@@ -126,7 +124,7 @@ function Base.show(io::IO, ::MIME"text/plain", tree::AVLTree)
126124
else
127125
println(io, "AVLTree")
128126
str = AbstractTrees.repr_tree(tree.root, context=io)
129-
print(io, str[begin:(end - 1)]) # remove \n at end
127+
print(io, rstrip(str)) # remove \n at end
130128
end
131129
end
132130

test/runtests.jl

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using TreeDataStructures
1+
using BinaryTrees
22
using AbstractTrees
33
using Test
44

5-
@testset "TreeDataStructures.jl" begin
5+
@testset "BinaryTrees.jl" begin
66
@testset "AVLTree" begin
77
# insert
88
tree = AVLTree{Int,Int}()
@@ -179,19 +179,14 @@ using Test
179179
tree[4] = 40
180180
tree[1] = 10
181181
tree[5] = 50
182-
root = tree.root
183-
@test children(root) === (root.left, root.right)
184-
@test children(root.left) === (root.left.left,)
185-
@test children(root.right) === (root.right.right,)
186-
@test children(root.left.left) === ()
187-
@test children(root.right.right) === ()
188-
@test nodevalue(root) == 30
189-
@test nodevalue(root.left) == 20
190-
@test nodevalue(root.right) == 40
191-
@test nodevalue(root.left.left) == 10
192-
@test nodevalue(root.right.right) == 50
193-
@test NodeType(root) === HasNodeType()
194-
@test nodetype(root) === typeof(root)
182+
@test children(tree.root) === (tree.root.left, tree.root.right)
183+
@test children(tree.root.left) === (tree.root.left.left,)
184+
@test children(tree.root.right) === (tree.root.right.right,)
185+
@test children(tree.root.left.left) === ()
186+
@test children(tree.root.right.right) === ()
187+
@test nodevalue(tree.root) === tree.root
188+
@test NodeType(tree.root) === HasNodeType()
189+
@test nodetype(tree.root) === typeof(tree.root)
195190

196191
# show
197192
tree = AVLTree{Int,Int}()

0 commit comments

Comments
 (0)