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

Summary Deletion from Doubly Linked List (beginning,end,specific position)

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

Deletion from Doubly Linked List (beginning,end,specific position)

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
2
Written in
2022/2023
Type
Summary

Subjects

Content preview

2.12 Deletion from Doubly Linked List
(beginning,end,specific position) | Data Structures Tutorials
Jenny's Lectures CS IT
in this video we will see how to delete data from our doubly linked list. We have already
discussed how to maintain this tail and head and how to create this W linked list in the previous
video. The first task is you have to free this memory you see memories very crucial part so we
can not leave it like this. We are going to create a function you can say void delete from Big D
fine and here first of all we 're going to take another pointer that is M and Y we have I have
already discussed here. fine so another important point is you how to maintain a pointer to this
node fine so you will take another point of that is temp. How we can access this part we can
write head and previous is equal to null it means here we are going to store 0 it means this link
has been broken fine and if you want you can also store here 0. The address of this node is
about 400 from where I can get 400 here we have 400.
Leicester 's m / t so here what you can print simply list is empty fine I guess you can all write
down this thing now in else part what you will do now. We are also going to maintain a pointer
that is spam which is going to point this node. After that we can do free and M so now first of all
what we will do we will declare another pointer. How to delete a node from a specific position
can be done before going to the third function I want to tell you something see if you do n't get
this double pointer concept then what you can do. So how we can change obviously we need
some point are using a pointer only we can access these parts. We will ask from the user from
which position he wants to delete the data and to get the input we need a variable you can say
post field. have address of the next node and address of previous node that is why deletion is
also easy in doubly linked list because in this case we need only one pointer but in singly linked
lists we need two pointers.
We have 100 address of this food and we have a pointer to this node that is temp. this temp so
in M now we will store temp off next it means temp next means hundred fine so in temp we are
going to store temp next now it is having hundreds so now temp is pointing to the snow 's right
and we will do it I plus plus now. The time complexity for this case has what now we have
prover still here means one and two nodes if position is suppose 10 so you need to traverse 10
nodes. and pointer to the to this node is 10 so here I can write temp next temp next means we
$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