Hot Topics

Data Structure
Linked List
Linked list is a type of linear data structure that is made by collection of nodes.It is a dynamic data structure whose size can be increased and decreased during runtime.This way there is no wastage of memory.It is easy to do insertion and deletion because we don’t need to shift element.Node is a collection of data and next node address pointer of node.

Types of Linked List
Singular Linked List
Singular Linked List follows the basic structure of a Linked List which is made up of collection of nodes and each node contains a data and the address of next node.
class Node
{
public:
// data members of class
int data;
Node *next;
// constructor
Node(int d)
{
this->data = d;
this->next = NULL;
}
// Destructor
~Node()
{
if (next != NULL)
{
delete next;
this->next = NULL;
}
}
} // end of Node class