Write down the procedure to reverse a singly linked list. , Data Structure & Algorithms

Assignment Help:

Ans:

A procedure to reverse the singly linked list:

reverse(struct node **st)

{

struct node *p, *q, *r;

p = *st;

q = NULL;

while(p != NULL)

{

r =q;

q = p;

p = p        link;

q        link = r;

}

*st = q;

}


Related Discussions:- Write down the procedure to reverse a singly linked list.

Breadth-first search , 1. Apply the variant Breadth-First Search algorithm ...

1. Apply the variant Breadth-First Search algorithm as shown in Figure 2 to the attached graph. This variant is used for computing the shortest distance to each vertex from the sta

Design a doubly linked list, Instructions : You have to design a dou...

Instructions : You have to design a doubly linked list container. The necessary classes and their declarations are given below The main() function for testing the yo

Complexity classes, Complexity classes All decision problems fall in se...

Complexity classes All decision problems fall in sets of comparable complexity, called as complexity classes. The complexity class P is the set of decision problems which ca

Flowchart, conversion of centrigral to frahenhit

conversion of centrigral to frahenhit

Draw the process flow diagram, Draw the process flow diagram: Anand   ...

Draw the process flow diagram: Anand   Dairy (AD) sources 150,000 litres of milk daily from large number of local villagers .The milk is collected from 4:00 AM to 6:00 am and

Define rule-based expert system, 1. Define the following terms in a rule-ba...

1. Define the following terms in a rule-based expert system? a) Knowledge base b) Inference engine 2. What is a fuzzy rule? Explain the difference between classical and fuzzy

Determine in brief the painter algorithm, Determine in brief the Painter A...

Determine in brief the Painter Algorithm a) The farthest polygon, namely the rectangle PQRS, is stored first. (b) The next farthest, the quadrilateral ABCD, is superpo

Arrays, Data array A has data series from 1,000,000 to 1 with step size 1, ...

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Deletion, sir how can i explain deletion process in a data structure

sir how can i explain deletion process in a data structure

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd