Feb 19, 2013 at 5:00am
#ifndef SLLIST_H
#define SLLIST_H
struct Node
{
int info;
Node *link;
};
class SLList
{
public:
SLList();
void addFirst(int x);
void addLast(int x);
bool deleteNode(int x);
void print();
private:
Node *first;
Node *last;
int size;
};
#endif
-------------------------------
what does Node*link mean and how does it work?
Feb 19, 2013 at 5:43am
This is a pointer to next Node to link all nodes in the list in one long chain.
Feb 19, 2013 at 10:16am
It a structure pointer , so that we can attach n number of nodes to it ..
Ex: Train
Start with an engine .. then connect the boxes[bogie] how much u need .. connection can be done through link pointer