Question: Write a simple abstract ordered_set class (an interface) whose methods include void insert(T val), void remove (T val), bool lookup (T val), and bool is_empty(),

Write a simple abstract ordered_set class (an interface) whose methods include void insert(T val), void remove (T val), bool lookup (T val), and bool is_empty(), together with a language-appropriate iterator, as described in Section 6.5.3. Using this abstract class as a base, build a simple list_set class that uses a sorted linked list internally. Try this exercise in C++, Java, and C#. Note that (in Java and C#, at least), you will need constraints on T. Discuss the differences among your implementations.

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is an example of an abstract orderedset class in C template class orderedset public virtual voi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Language Pragmatics Questions!