Data Structures...
Or, vectors, lists, stacks, Oh My!
[09.27.2006] [Keywords: Computer Science, Data Structures, C++]
Ok, so basically it's sample code that I've given to my Data Structures class. It's very simple, and it provides a very minimal example of using some of the STL's built-in containers. It's also hopefully commented well enough that it's understandable. You can download the whole zipfile, or see the individual files below. (Hhopefully this list will be updated as this semester progresses.)
- Node.h - A definition of a simple Node using a struct.
- Thing.h - A definition of a simple Thing class in a custom namespace.
- list.cpp - A program to illustrate the list Class and the Iterator defined in the STL.
- stack.cpp - A program to illustrate the stack Class defined in the STL.
- testNode.cpp - A program to create a simple linked list of Nodes (defined in Node.h) using pointers.
- testThing.cpp - A program to illustrate the Default Copy Constructor of a class (defined in Thing.h)
- thingList.cpp - A program to illustrate the creation of a list of custom objects (using the Thing class defined in Thing.h)
- vector.cpp - A program to illustrate the use of the vector class defined in the STL.