State algorithm to insert node p at the end of a linked list, Data Structure & Algorithms

 

Algorithm to Insert a Node p at the End of a Linked List is explained below

Step1:   [check for space]

If new1= NULL output "OVERFLOW"

And exit

Step2:   [Allocate free space] New1 = create new node.

Step3:   [Read value of information part of a new

node]

Info[new1]=value

Step4:   [Move the pointer to the end of the list]

node = previous=strt

Repeat while Node != NULL Previous=node

Node = Next[Node]

Step5:   [Link currently created node with the last node of the list]

Next[New1] = Node

Next[Previous] = New1

Step6:   Exit.

Posted Date: 7/13/2012 2:08:33 AM | Location : United States







Related Discussions:- State algorithm to insert node p at the end of a linked list, Assignment Help, Ask Question on State algorithm to insert node p at the end of a linked list, Get Answer, Expert's Help, State algorithm to insert node p at the end of a linked list Discussions

Write discussion on State algorithm to insert node p at the end of a linked list
Your posts are moderated
Related Questions
Define data model?  A data model is a collection of conceptual tools for explaning data, data relationships, data semantics and consistency constraints.


what is folding method?

I need a recursive algorithm to implement the FIRST function to any grammar

It is a useful tool for indicating the logical properties of data type. It is a collection of values & a set of operations on those values. Methodically, "a TYPE is a set, & elemen

what are the disadvantages of sparse matrix?

Program segment for the deletion of any element from the queue delmq(i)  /* Delete any element from queue i */ { int i,x; if ( front[i] == rear[i]) printf("Queue is

what is folding method?

A freight train from Melbourne is approaching Sydney, carrying n cars of cargos. The cargos are to be delivered to n different cities in the metropolitan area of Sydney - one car f

The size of stack was declared as ten. Thus, stack cannot hold more than ten elements. The major operations which can be performed onto a stack are push and pop. However, in a prog