Question
The Tree-o-Matic Software company specializes in all things related to trees. You have been asked to design a new utility class to verify whether a
The Tree-o-Matic Software company specializes in all things related to trees. You have been asked to design a new utility class to verify whether a given tree-based array is a Binary Search Tree.
Assignment:
Create a BSTChecker class with the following capabilities:
Feature | Signature | Requirement |
Constructors | N/A | A utility classno constructor needed |
Methods | static boolean isValid(Integer [] intArray) | Returns true if array is a valid binary search tree. Preconditions: throws NullPointerException if intArray is null. Note: must be explicitly thrown. Implementation does not need to be recursive. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started