Implement a method called 'positives". Add this method to a class in the
collection hierarchy so both the Array class and the OrderedCollection class
inherit the method. The method is to be sent to collection objects that contain
numbers. It returns the number of elements in the collection that are greater
Implement a binary search tree. The each node of the tree is to contain a key
and a value. The nodes are ordered in the tree by the keys. So all the nodes in
the left subtree of the root node have keys less than the root node. Assume
that the keys in the tree are all of the same type. For example all the keys in
one tree might be integers and in another tree all the keys might be strings. A
binary search tree must have the following methods:
the number of nodes in the tree
the value in the node that has the given key
aKey put: aValue
the tree has a node with the given key, replace the node's value with aValue.
This means a key can not be repeated in a tree. If no node has the given key
then add a new node in the binary search tree with the given key and value.
There is no need to balance the tree.
is to have one parameter. aBlock is evaluated for each node in the tree with
the block's parameter the nodes value.
the first value in the tree found to make aBlock evaluate to true. The order of
searching the tree is an implementation detail.
methods can be added if needed or desired.
textbooks show how to implement a binary search tree using an array. Do no use
such implementations in this assignment. Implement the tree with nodes and links.
Provide unit tests for problem 1 & 2.
might find this assignment a bit harder than the previous assignments. So you
might want to start on it early.