okay, so i do not understand the building of a link list although my professor has explained during my tutorial before. I cant get the concept of insertion a node and deletion of a node. i tried building a linked list myself which is mostly memorised from books. therefore can u please kindly explain to me the steps on how to build a linked list and insertion of a node. This is my linked list code

class nodetype
{
public:
	int data;
	
public:
	nodetype *link;
	nodetype();
	~nodetype();
};

class list
{
	nodetype *head;
	nodetype *last;
	nodetype *current;
	nodetype *pointer;

public:
	add();
	delete();
	traverse();

};
nodetype::nodetype()
{
	data = 0;
	link = 0;
}
nodetype::~nodetype()
{
	data = 0;
	link = 0;
}
list::add(nodetype *newnode)
{
	if (head == NULL)
	{
		head = last = newnode;
		nodetype = new newnode
	}
	else
		newnode->link;
}
list::traverse()
{
	current = head;

	while (current != NULL)
	{
		current = current -> link;
	}
}
list::delete()
{
	current -> link = p -> link -> link;
	pointer = current -> link;
	current -> link = q -> link;
	delete pointer;
}

This might help. If not, let me know what parts you didn't understand so I can make it better.

I understand the concept of it very well because i read it many times while researching on the web. However most websites do not show the implementation. Like what are the steps needed for insertion of nodes and deletion of a code. I think the website provided has been a great help to me :). i am still reading through it so if i have any doubts in mind, i would like to ask you.

>However most websites do not show the implementation.
The three most common cases I've found in research are:

  1. No implementation is provided.
  2. Only pseudocode is provided.
  3. A very weak implementation is provided, nearly always omitting the "hard" parts.

In my tutorials I make it a point to cover as much as possible, including all of the hard parts and commonly mentioned but rarely shown variations. Basically the stuff I always wanted when learning. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.