Some questiong about Data Structures in Java
1. A Heap is defined as a special kind of BinaryTree and a BinarySearchTree is a kind of BinaryTree, yet neither of these two containers is an extension of BinaryTree, Explain Why.
2. For any Container to be useful, we must be able to add and remove objects, yet Container does not define any commands for adding and removing, Why?
3. In terms of accessing all the elements in a container, how does an Iterator object offer an advantage over simple query methods that actually iterate through all objects in the container for you? When is it better to use a simple query as opposed to returning an Iterator?
4. If Java provided the capability for generic types, how would the Container hierarchy be affected? Specially, how would interface Container change?
----------------------------
these questions are excersices of book "Fundemantals of OOP & Data Structures in Java"