Link list ADT

What is linked list? Linked List consists of a sequence of nodes. These nodes are made-up of the following: A Data Field for housing the data item One or Two Reference/s for pointing at other node/s i.e. pointing to the next/previous node/s. In this data structure, the nodes are allowed to be inserted and removed at any point in the list in constant time, however random access in not possible. [Read More]

Stack implementation using linked list

We will be understanding the stack implementation using linked list. So, please understand the link list before proceeding. Lets understand how we can implement the different operation using linked list. CPP implementation Here is how we use linked list to implement stack in cpp: #include <iostream> using namespace std; struct node { int info; struct node \*next; }; struct node \*top; int empty() { return((top == NULL)? 1:0); } void push(int n) { struct node \*p; p=new node; if(p! [Read More]