Skip to content

deangelacgn/generic-binary-search-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Generic Binary Search Tree

This BST class implements the following public methods:

  • find_min()
  • find_max()
  • contains()
  • empty()
  • size()
  • retrieve()
  • preorder()
  • postorder()
  • inorder()
  • clear()
  • insert()
  • remove()

Moreover, this BST class has 4 different constructors:

  • Default constructor
  • Copy constructor
  • Range constructor
  • Initializer list constructor

You can find more details about the implementation and description of all methods and constructors here.

Prerequisites

In order to use this BST class your compiler needs to support C++11 Standard. If you use a GCC compiler, at least GCC 4.8.1 is needed.

How to use

Clone this repo to your local machine and move your .cpp files to the src folder inside the project.

Running the tests

Inside the src folder you will find a drive_bst.cpp that has a few unit tests. Compile and run this file to check if everything is okay.

g++ -std=c++11 drive_bst.cpp -g && ./a.out

If all tests pass, you can start playing around with the BST by including bst.h in your own .cpp files.

Authors

  • Deangela C. G. Neves
  • Maria Clara Martins

About

A generic implementation of a Binary Search Tree in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages