Skip to content

tranzystorekk/btree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

B-tree

Functional implementation of B-tree structure in Scala.

General Info

Functional implementation of the B-tree structure in the Scala language. It is a project implemented as part of the JPS (Symbolic processing languages) course at the EiTI Faculty of Warsaw University of Technology. Project implemented in a two-person team.

Requirements

  • Scala
  • IntelliJ IDEA with the Scala plugin installed (optional)

Build Project

Run

Use command sbt run in terminal, or execute the run task in IntelliJ IDEA.

Main Loop

Running project starts a main loop, which allows to use simple methods. It can show that b-tree really works. Those methods allow to use only integers, but b-tree can contain other comparable types.

Available methods:
  • add [Int] - add value to BTree
  • rm [Int] - remove value from BTree
  • is [Int] - check if a value exists in BTree
  • print - print a DFS view of BTree
  • help - print help prompt
  • exit - exit program

Tests

In the src/test/scala directory are Unit Tests (written using the scalatest framework) for the implemented b-tree.

Samples of tests

When many values are inserted, BTree contains them.
When there are many values, and one is removed, then Btree no longer contains it.
When value is removed, BTree no longer contains it.

Running Tests:

Use command sbt test in terminal, or execute the test task in IntelliJ IDEA.

Scaladoc

Scaladoc in html version are stored in docs/html directory

How B-tree works

Example of b-tree

btree_example

Insert Method

Insert

Delete Method

Delete

Authors

  • Marcin Puc
  • Mateusz Wasiak

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages