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)

Queue Operations

 Queue Operations are......

         Enqueue—Add an item(new item in back side) to the end of the queue.

         Dequeue—Remove an item from the front.

         Queue Front—Who is first?

         Queueu End—Who is last?

 

Page 2 of 4