100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Reverse a Doubly Linked List _ Data Structures & Algorithm Tutorials

Rating
-
Sold
-
Pages
1
Uploaded on
22-04-2023
Written in
2022/2023

Reverse a Doubly Linked List _ Data Structures & Algorithm Tutorials

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Course

Document information

Uploaded on
April 22, 2023
Number of pages
1
Written in
2022/2023
Type
Summary

Subjects

Content preview

2.13 Reverse a Doubly Linked List | Data Structures &
Algorithm Tutorials
Jenny's Lectures CS IT
We have discussed how to reverse a singly linked list to check out those videos I 'll provide you
the link in the description box you can check out there the complete a series on linked lists in
data structure. The reverse is having four nodes and I don't want to swap the nodes like this this
this node would and with this nodes 7 would go here and 6 would go there like this. We are our
main motto is what we are going to show up these values so now we can not do this thing now
what we can do we have to store this this point this address also we need some another pointer.
here obviously we are not going to move this head fine so we will take what another pointer
suppose I am taking a temp pointer. The first step is we are going to point this current here so
here what I want to store that is 200 so now from where I can get this 200 200. After that we will
move this current and next node would be this node now so you have to maintain what two
pointers fine so now I will write the code.
Current is also having 150 this pointer now this pointer is also pointing to this node now the
current node is this one now I want to swap these values see this previous pointer this previous
point is pointing to here right. Now I want this pointer to contain address of the previous node
that is 200 so we will swap these links now. read before the DS line after this line while and you
will write what this current pointer not equal to none well then we are going to repeat these four
steps please do n't write this step in while loop because again we will enter into while loop then
again current would be head so again current will point to this node but I wo n't want this thing
because we have done with this node. We have two extra pointers current then next node so we
can use these pointers. We have to swap these pointers also head would be here and tail would
be tail. After reversing this head and tail before these lines you can print what the data head of
data so it should print 6 and the tail arrow data.
The iterative approach to reverse the doubly linked list using recursion also we can reverse the
list fine and after the worst thing you can do it something like this. In next video we will
implement a circular linked list we will write a C program fine how to create a circular likeness.
$8.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
pranavnawandar

Also available in package deal

Get to know the seller

Seller avatar
pranavnawandar mahindra university
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
19
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions