• 0

Linked List (cdt)


Question

Just confused about this.

Does this mean that instead of being reference based, you insert ints, doubles, etc.

edit: i think what was meant was that it was array based.

Edited by Goalie_CA
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hmmm... isn't an abstract data type just a definition or interface? I would guess that a cdt is an explicit implementation of that interface. Just a guess, though. I think it has little to do with reference/value types. Maybe I'm not fully understanding your question... it's late. :)

Link to comment
Share on other sites

  • 0

an abstract data type is just the declaration part of the class. plain and simple. if you want to do "information hiding" with your source code, this is a good way to approach it. place your declaration (ADT) in a .h file and your implementation of those funtions (or can they be called methods in this case?) and other items relating to that class in a .cpp file (assuming that you are talking about C++).

to create a linked list you should create a struct that represents a node (can be seen as an element of this linked list) first. the node will contain a pointer to another node and an "info" variable. it is best to use templates when creating linked list because it will allow you to use many types.

the linked list class, itself, generally (for single linked list) has:

- pointer pointing to the first node

- pointer pointing to the last node

- int that holds the length of the list

- etc

Im not really sure what your originaly question was because you seem to have edited it. oh well, if you need more help, just ask.

hope this helps,

STV

Link to comment
Share on other sites

  • 0
When I was in the university some time ago, linked list fell under ADTs.

that is how they teach it and choose to structure the course because it allows students to grasp the concepts better, i guess.

STV

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.