4 ms·
You seem to imply that abstract data types and data structures are in some way similar (or related). It's not the case; an ADT is not a kind of, nor an alternat
by corentin 19y ago
You seem to imply that abstract data types and data structures are in some way similar (or related). It's not the case; an ADT is not a kind of, nor an alternative to, a data structure (and vice versa). They are different things for different purposes, just like an algorithm isn't the same thing as a data structure.
I acknowledge that their names can be confusing (both contain the word "data"). "data structure" isn't a bad name; we understand that it's about how data is organized. But "abstract data type" is less clear, indeed.
edit: I think I found what may confuse you: I guess it's a visualization problem. When you're visualizing a data structure, it probably looks like boxes connected to each other with arcs. And I think your book has nice pictures for ADTs, too (stacks, queues, etc. drawn using boxes and maybe arcs as well). Whereas it's clear that an algorithm is very different from a data structure because it's described using pseudo-code. Forget the graphical representation for ADTs; think of them instead as a list of "rules" of the form "when I dequeue something from a queue, I get the last item that was enqueued".