Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 1.33 KB

File metadata and controls

26 lines (15 loc) · 1.33 KB

Lazy Binary Search Tree Operations

This project is an implementation of a Binary Search Tree data structure in Java. A Binary Search Tree is a data structure that allows for efficient searching, insertion and deletion of elements in a sorted manner. This implementation includes functionality to print the tree, find the height and size of the tree, insert and delete nodes, find the minimum and maximum value in the tree, and check if a specific value is present in the tree.

Using the Program

  1. Compile the program in your IDE's terminal, ex: javac Main.java Scheduler.java
  2. Run the program with the first argument being the name of the input file, and the second argument being the name of the output file, ex: java Main example.txt output.txt

The program expects an input file containing a series of commands, one per line. The commands that are currently supported are:

'PrintTree': prints the tree in order

'Height': prints the height of the tree

'Size': prints the number of nodes in the tree

'Insert':: inserts a new node with the given value into the tree 'Delete':: deletes the node with the given value from the tree

'FindMin': prints the minimum value in the tree

'FindMax': prints the maximum value in the tree

'Contains:': checks if the tree contains a node with the given value and prints True or False