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
The objective analysis of an algorithm is to determine its efficiency. Efficiency is based on the resources which are used by the algorithm. For instance, CPU utilization (Ti

A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X"

Which sorting algorithm is easily adaptable to singly linked lists? Simple Insertion sor t is easily adabtable to singly linked list.

Write an algorithm in the form of a flowchart that: inputs top speeds (in km/hr.) of 5000 cars Outputs fastest speed and the slowest speed Outputs average (mean) s

Example: Insertion of a key 33 into a B-Tree (w/split) Step 1: Search first node for key closet to 33. Key 30 was determined. Step 2: Node pointed through key 30, is se

. Create a decision table that describes the movement of inventory

Area Subdivision Method In this method, the viewport is examined for clear decisions on the polygons situated in it, in regard to their overlap and visibility to the viewer. Fo

Q. Develop a representation for a list where insertions and deletions can be done at either end. Such a structure is known as a Deque (Double ended queue). Write functions for inse

A set s is conveniently shown in a computer store by its characteristic function C(s). This is an array of logical numbers whose ith element has the meaning "i is present in s". As

Q. Create a heap with the given list of keys: 8, 20, 9, 4, 15, 10, 7, 22, 3, 12                                                  Ans: Creation