Skip to content

realmar/binary-search-tree-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Search Tree

Usage

Please refer to the main.cpp but here are the methods listed you can use on this class:

// Takes 2 or 0 parameter
// you can give it an array which will be converted into a BST Tree
BST<int>* bst = new BST<int>(arr, size);

bst->search(2);       // searches for an element, returns a pointer to the element if it exists
                      // and a NULL pointer if it doesnt exists
bst->insert(74353);   // inserts a single element into the tree, returns void
bst->del(2);          // delete a specific element in the tree, returns void
bst->dump();          // prints all elements, returns void

// converrFrom takes an array and pushes it into the BST
int test_arr[2] = {1, 2};
bst->convertFrom(test_arr, 2);    // returns void

About

a binary search tree implemented in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages