Perhaps a more appropriate title for this chapter would have been “Reusable Data Struc- tures.” Comment on how each of the following entities or concepts contributes to the reusability of data structures:

a) classes
b) class templates
c) inheritance
d) private inheritance
e) composition


a) Classes allow us to instantiate as many data structure objects of a certain type (i.e.,class) as we wish.
b) Class templates enable us to instantiate related classes, each based on different type parameters—we can then generate as many objects of each template class as we like.
c) Inheritance enables us to reuse code from a base class in a derived class, so that the derived-class data structure is also a base-class data structure (with public inheritance, that is).
d) Private inheritance enables us to reuse portions of the code from a base class to form a derived-class data structure; because the inheritance is private, all public base-class member functions become private in the derived class. This enables us to prevent clients of the derived-class data structure from accessing base-class member functions that do not apply to the derived class.
e) Composition enables us to reuse code by making a class object data structure a member of a composed class; if we make the class object a private member of the composed class, then the class object’s public member functions are not available through the composed object’s interface.

Computer Science & Information Technology

You might also like to view...

You are required to create a conceptual data model of the data requirements for a company that specializes in IT training. The Company has 30 instructors and can handle up to 100 trainees per training session. The Company offers five advanced technology courses, each of which is taught by a teaching team of two or more instructors. Each instructor is assigned to a maximum of two teaching teams or may be assigned to do research. Each trainee undertakes one advanced technology course per training session.

(a) Identify the main entity types for the company. (b) Identify the main relationship types and specify the multiplicity for each relationship. State any assumptions you make about the data. (c) Using your answers for (a) and (b), draw a single ER diagram to represent the data requirements for the company.

Computer Science & Information Technology

External drives can be connected using a(n) ________ port

A) USB B) PATA C) SATA D) WLAN

Computer Science & Information Technology

________ are defined as the visual and audio elements that occur as the slides change

A) Transitions B) Animations C) Action buttons D) Motions

Computer Science & Information Technology

The expression sqrt(pow(abs(num1), num2)) is a valid expression.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology