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.

Fifo, give any example of page replacement using fifo and use your own refe...

give any example of page replacement using fifo and use your own reference string

Multiplication, Implement multiple stacks in a single dimensional array. Wr...

Implement multiple stacks in a single dimensional array. Write algorithms for various stack operations for them.

Define big omega notation, Define Big Omega notation Big Omega notatio...

Define Big Omega notation Big Omega notation (?) : The lower bound for the function 'f' is given by the big omega notation (?). Considering 'g' to be a function from the non-n

Multiple stack, implement multiple stack in single dimensionl array.write a...

implement multiple stack in single dimensionl array.write algorithms for various stack operation for them

Algorithmss, calculate gpa using an algorithm

calculate gpa using an algorithm

Algorithm for multiplication of two sparse matrices using li, algorithm for...

algorithm for multiplication of two sparse matrices using linked lists..

Give example of assertion and abstract data type, Give example of assertion...

Give example of assertion and abstract data type For illustration, consider Natural ADT whose carrier set is the set of non-negative integers and whose operations are the usual

Primitive data structure, Primitive Data Structure These are the basic ...

Primitive Data Structure These are the basic structure and are directly operated upon by the machine instructions. These in general have dissimilar representations on different

Define queue fifo ?, A queue is a particular type of collection or abstract...

A queue is a particular type of collection or abstract data type in which the entities in the collection are went in order and the principal functions on the collection are the add

Array implementation of a dequeue, If a Dequeue is implemented via arrays, ...

If a Dequeue is implemented via arrays, then this will suffer with the similar problems which a linear queue had suffered. Program 8 gives the array implementation of Dequeue.

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