Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikhil-jindal12/intbinarysearchtree
Contains the implementation for a Binary Search Tree that contains integers as keys.
https://github.com/nikhil-jindal12/intbinarysearchtree
binarysearchtree java-8 javadoc-documentation
Last synced: 9 days ago
JSON representation
Contains the implementation for a Binary Search Tree that contains integers as keys.
- Host: GitHub
- URL: https://github.com/nikhil-jindal12/intbinarysearchtree
- Owner: nikhil-jindal12
- Created: 2023-10-06T20:36:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-20T23:44:50.000Z (about 1 year ago)
- Last Synced: 2024-11-13T04:13:27.936Z (2 months ago)
- Topics: binarysearchtree, java-8, javadoc-documentation
- Language: Java
- Homepage: https://nikhil-jindal12.github.io/IntBinarySearchTree/
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Integer Binary Search Tree
This repository contains the implementation for a Binary Search Tree (BST) that holds integers as its data points. The two classes used to implement this are `Node.java` & `BinarySearchTree.java`.
The `BinarySearchTree.java` class contains the following unique methods:
- `Node getRoot()` - returns the root of the BST
- `int getNodeCount()` - returns the number of nodes in the BST
- `void insert(Node root, int key)` - inserts a node in the BST
- `void preorderRec(Node root)` - recursive method that prints the preorder traversal of the BST
- `Node kthBiggest(Node root, int k)` - returns the kth biggest element in the BST
- `int sum(Node root)` - returns the sum of all the keys in the BST