Creating a java binarysearchtree program based on custom API

Posted by:Prof. Lexx Posted on:May 6,2016

For this programming assignment you are to deliver an implementation of a Java class named StringBinaryTree that adheres to theStringBinaryTree API specification provided. Note that you may, but need not, extend the published API to include apublic static void main(String[] args) method to be used for stand-alone testing and demonstration.

Your submission should be a demonstration of your best effort at this time. Aim for code that is easy to read as well as correct. Your submission must match the syntactic specification of the API. Note that this assignment has a companion Virtual Programming Lab (VPL) activity that is required and which performs basic checks (file naming, compilation, API, style convention):String Binary Tree – VPL

You must submit a single Java source code file whose name is


StringBinaryTree API Specification

StringBinaryTree API

Class StringBinaryTree

public class StringBinaryTreeextends Object

A simple binary tree whose root holds a non-null String value.

The StringBinaryTree datatype is defined recursively as being comprised of a value of type String, a reference to a left child of type StringBinaryTree, and a reference to a right child of type StringBinaryTree. As this datatype represents a binary tree, there must be no duplicate references nor any references to the root.

The empty tree is distinguished by the following properties:
numberOfNodes() == 0,
isEmpty() == true, and
height() == -1.


  • ancestor = a parent, grandparent, great-grandparent, etc.
  • descendant = a child, grandchild, great-grandchild, etc.
  • height = the length of the longest path to a leaf
  • internal = a tree with at least one child
  • leaf = a tree with no children
  • root = any StringBinaryTree object
  • tree = a StringBinaryTree with all its descendants

Prof. Lexx

Overview I have a Bachelor of Arts, majoring in English and minoring in History. I have worked in various fields ranging from academic research to freelance translating to editing to customer support and data entry. These include editing my old university's newspaper as well as co-leading their creative writing team; serving as a junior member in the history department's research network; publishing music and film reviews for several different magazines and webzines; and translating papers and books for numerous researchers in various languages, including Russian, Spanish, and Romanian. I am also a skilled typist, with a rate of at least 70 words per minute, and have myself digitized dozens of books and essays for both private and commercial use. I have a very strong work ethic, and make sure to prioritize the task I am given so that it is completed as quickly as possible. I am organized and disciplined, ensuring a job done professionally and efficiently.

    I have a background of 8 years in writing profession and currently pursuing also as an editor and proofreader. I have a knack for writing and thus, it was obvious to enhance my skills and serve others. Currently joined ‘Member of Association of Professional Writers and Editors’ a

    Pro Alex