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
Explain the Abstract data type assertions Generally, ADT assertions translate into assertions about the data types which implement ADTs, which helps insure that our ADT impleme

We have discussed already about three tree traversal methods in the earlier section on general tree. The similar three different ways to do the traversal -inorder , preorder, and p

A graph with n vertices will absolutely have a parallel edge or self loop if the total number of edges is greater than n-1

Task If quicksort is so quick, why bother with anything else? If bubble sort is so bad, why even mention it? For that matter, why are there so many sorting algorithms? Your

Program for Linear Search. Program: Linear Search /*Program for Linear Search*/ /*Header Files*/ #include #include /*Global Variables*/ int search; int

1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=216.65 5. else if h T=216.65+(h*0.001) 6. else if h T=228.65+(h*0.0028) 7. else if h T=270.65 8.

In a sorted list, Binary search is carried out by dividing the list into two parts depends on the comparison of the key. Since the search interval halves each time, the iteration o

Describe an algorithm to play the Game of Nim using all of the three tools (pseudocode, flowchart, hierarchy chart)

Determine the effect of Ruby in implementation of string Ruby has a String class whose instances are mutable sequences of Unicode characters. Symbol class instances are charact

null(nil) = true                     // nil refer for empty tree null(fork(e, T, T'))= false   //  e : element , T and T are two sub tree leaf(fork(e, nil, nil)) = true leaf(