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.

Direct file organisation, It offers an effective way to organize data while...

It offers an effective way to organize data while there is a requirement to access individual records directly. To access a record directly (or random access) a relationship is

Randomized algorithm, need an expert to help me with the assignment

need an expert to help me with the assignment

Stack, infix to revrse polish

infix to revrse polish

Methods, what is folding method?

what is folding method?

Binary search tree, write an algorithm to delete an element x from binary...

write an algorithm to delete an element x from binary search with time complex

Array implementation of a multiqueue, Program gives the program segment by ...

Program gives the program segment by using arrays for the insertion of an element to a queue into the multiqueue. Program: Program segment for the insertion of any element to t

Explain space complexity, Explain Space Complexity Space Complexity :...

Explain Space Complexity Space Complexity :- The space complexity of an algorithm is the amount of memory it requires to run to completion. Some of the reasons to study space

Write procedure to the insert a node into the linked list, Q. Write a proce...

Q. Write a procedure to the insert a node into the linked list at a particular position and draw the same by taking an example?

Data mining assignment, The assignment aims at consolidating your knowledge...

The assignment aims at consolidating your knowledge on data mining techniques and developing practical skills through solving a problem of transcription factor binding sites recogn

Multiqueue, data structure for multiqueue

data structure for multiqueue

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