Linked Lists in C



      1  LINK OR POINTER: A pointer also called a link or a reference, is defined to be a variable that give the location of some other variable(point to the next consecutive node), typically of a structure containing data.


Creation,Insertion ,Deletion algorithms of a Linked List


Algorithm  of creation of a Linked List

CREATE---In this algorithm a Linked List of nodes is created. The list is pointed by pointer first, the last node of the list points to NULL., indicating the end of the list.

Doubly Linked List

In Doubly linked list, we can store in each node not only the address of next node but also the address of the previous node in the linked list.

Reverse a Linked List

Reversing  a Linked list is the useful operation in which we change next to prev, prev to current and current to next.

Reverse String using Stack


Stack is LIFO(LAST IN FIRST OUT) linear data structure. It can have 2 operations 1)Push(add a new item)  2)Pop(delete an item).In this example I have shown how  to reverse a string from last character to the first (example…..RAM  OUTPUT IS MAR)

Page 2 of 4