An implementation of the Train and Car classes will be required, using as many levels of inheritance needed. The manipulations might include create, copy, print and update. Trains will be stored in a collection. The implementation of the train collection is divided into 3 sets of increasing technical difficulty; it is up to you which level of difficulty you implement. Set 1. Create an array of trains. Implement functions such as insert, remove, sort and search by train number, type of train or destination. Set 2. Use linked lists to store the trains. Implement functions such as insert, remove and search by train type, train number or destination. Set 3. Use a binary tree to store the trains. Implement functions such as create, remove and search. The search can be done by train type, train number or destination. A self-balanced tree will be rewarded. Use private member functions for common functionality that should not be exposed in the public interface. For the searching function, you can either implement linear or binary search algorithms. It is up to you which implementation is less complex in terms of Big-O notation according to your data structure. Please include in your development report an analysis of the complexity of the search strategy implemented in any case.
Aucun commentaire:
Enregistrer un commentaire