Data types constructed from the four fundamental data types

Hi,

I've been searching everywhere, and simply can't find examples of abstract data types constructed from the four fundamental data types. I'm trying to find examples that implement the following combinations,

- a list with components that are a tree
- a graph with components that are lists
- a list with components that are a set
- a tree with components that are lists
- a list with components that are graphs

eg: a set of lists could be used to model a map and so on. I'm trying to think of these from a purely theoretical standpoint, prior to implementation. Has anybody got any ideas of theoretical ADTs for the above combinations?

Any help appreciated.

Thanks

nhay59Asked:
Who is Participating?
 
colr__Connect With a Mentor Commented:
Not sure if I understand you correctly, but since the collection API is littered with classes that imlement the Colelction interface, then each of thes classes can be used to hold instances of each other.

For example, for your first point "- a list with components that are a tree", you could use an ArrayList that holds TreeMap's.

Apologies if Ive understood you wrong.

colr__
0
 
Mayank SConnect With a Mentor Associate Director - Product EngineeringCommented:
You can perhaps create such collections using generics in Java 5.0, like:

ArrayList <TreeMap> list = new ArrayList <TreeMap> () ;
// is: >> "- a list with components that are a tree", you could use an ArrayList that holds TreeMap's.

Same way you can define the others.
0
 
nhay59Author Commented:
Hi,

Thanks for the replies.

Have a good weekend.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.