Hi there,
Quote:
Originally Posted by shifter
1) Stack, queue, tree are examples of abstract data types?
|
yes, I would say so. These three are basic, but generic concepts of data organization. Each of these implies a certain way of how data is structured and how it can be accessed, but doesn't specify the nature of data objects being stored and handled.
Quote:
Originally Posted by shifter
2) Is it possible to implement abstract data types in pure C language?
|
Of course it is. It is possible to implement almost anything in pure C, since it is a turing-complete language. Typically, you would define a struct type holding all the necessary meta information of a single data element, and a set of functions that deal with these data elements (in C++ you would encapsulate that in a class).
If the solution is intended to be a generic one, you will probably have to deal with a fair amount of void*, sizeof(), and various type casts, but hey, that's why C is so much fun - because it lets you do anything.
[X] Doc CPU