Purchase Solution

Simple linked list C++

Not what you're looking for?

Ask Custom Question

When I typical write a linked list class to store int values I would setup the class something like this....
struct Node {
int _item;
Node *_next;
};
Node *_head;

However, I know have to write a program that will use IntNode.h to create a linked list implementation.

The way the designer setup this .h file is confusing me and have been unable to create the implementation cpp file.

Can someone review my IntNode.cpp and guide me on how to code the correct implementation ? No major changes can be made to the .h file.

The tester for the class would be a very simple program:
#include <iostream>
#include <string>
#include "IntNode.h"

int main()
Node NL;
NL = Node(1);

//add values
NL.info(8);
NL.info(7);
NL.info(6);
...
//display values
...
return(0);
}

Purchase this Solution

Solution Summary

Simple linked list C++ is devised.

Solution Preview

The basic trick here is to use one more class. There are many different ways of doing this.

1. You can define a class List and a private class Node inside the class List.
2. You can define the two classes and declare that one ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.