Question: The BinaryNode that we wrote in class only works with integers. You will modify it so that it is generic and can work with any
The BinaryNode that we wrote in class only works with integers. You will modify it so that it is generic and can work with any type.
a Add a type parameter to the class declaration, egT
b Replace all references to value being an int to your generic type parameter. Comment out the code in your binaryInsert and binarySearch methods for now
c Add a new field: a Comparator of the same generic type, eg Comparator
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
