Linked List Data Structure
- Objective:
Array implementation of a Linked List data structure.
- Description:
The goal is to build a linked list class that uses array implementation of a linked list. The maximum number of nodes that a linked list may have is specified as a parameter in the constructor.
- The << operator is being overloaded in order to accomodate for the output of the linked list elements.
- The linked list is actually constructed as an array of node objects. Each node object has two fields: _element, which contains the actual value of the node, and next, which is a pointer of type int to the next element in the list.
- The program also includes a main method which tests all the other methods in the Linked List class.
- The size method returns the size of the linked list, i.e. how many nodes does the structure contain; the isEmpty method returns True if the structure is empty, i.e size is equal to zero, and False otherwise.
- This program is coded in MicrosoftVisual C++, but it also compiles in the UNIX G++ C++ compiler.
- Implementation:
To view this program in MS Word format Click here