Skip to content

Jakemodel8/BinarySearchTree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

BinarySearchTree

Node

Collaborator

  • Nikhil Jindal

Two classes to implement a Binary Search Tree (BST). Node.java contains the Nodes for the tree.

Node contains:

  • getKey:

    • returns the key of the specified node
  • getter and setter methods for setting the right and left children

BinarySearchTree contains:

  • insert:

    • inserts a specified node in the BST depending on the node's key
  • preorderRec:

    • recursively traverses the BST in a preorder
  • sum:

    • returns the sum of all keys of the BST
  • kthBiggest:

    • returns the kth-largest Node in the BST
  • getRoot:

    • returns the root of the BST
  • getNodeCount:

    • returns the total count of nodes in BST

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages