Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
10 views
3 pages
Doubly Linked List
Code for doubly linked list
Uploaded by
Thanos
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save Doubly linked list For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
10 views
3 pages
Doubly Linked List
Code for doubly linked list
Uploaded by
Thanos
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Doubly linked list For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Doubly linked list For Later
You are on page 1
/ 3
Search
Fullscreen
#include <stdio.
h> printf("Enter value: ");
#include <stdlib.h> scanf("%d", &val);
struct node { printf("Enter location: ");
int data; scanf("%d", &loc);
struct node *next, *prev; inS(val, loc);
} *head = NULL; break;
void inB(int val); case 4:
void inE(int val); deB();
void inS(int val, int loc); break;
void deB(); case 5:
void deE(); deE();
void deS(int loc); break;
void dis(); case 6:
int main() { printf("Enter location: ");
int ch, val, loc; scanf("%d", &loc);
for (;;) { deS(loc);
printf("\nA.Insert:\t1.At Beginning\t2.At End\t3.At break;
Specific Location");
case 7:
printf("\nB.Delete:\t4.At Beginning\t5.At End\t6.At
dis();
Specific Location");
break;
printf("\n7.Display\t8.Exit\tChoice: ");
case 8:
scanf("%d", &ch);
return 0;
switch (ch) {
default:
case 1:
printf("Invalid input");
printf("Enter value: ");
}
scanf("%d", &val);
}
inB(val);
}
break;
void inB(int val) {
case 2:
struct node *newnode = (struct node
printf("Enter value: ");
*)malloc(sizeof(struct node));
scanf("%d", &val);
newnode->data = val;
inE(val);
newnode->prev = NULL;
break;
newnode->next = head;
case 3:
if (head != NULL)
head->prev = newnode; if (temp == NULL) {
head = newnode; printf("Invalid location. The position is beyond
the list length.\n");
}
free(newnode);
void inE(int val) {
return;
struct node *newnode = (struct node
*)malloc(sizeof(struct node)); }
newnode->data = val; }
newnode->next = NULL;
if (head == NULL) { newnode->next = temp->next;
newnode->prev = NULL; newnode->prev = temp;
head = newnode;
} else { if (temp->next != NULL)
struct node *temp = head; temp->next->prev = newnode;
while (temp->next != NULL)
temp = temp->next; temp->next = newnode;
newnode->prev = temp; }
temp->next = newnode; void deB() {
} if (head == NULL) {
} printf("Empty List\n");
void inS(int val, int loc) { return;
struct node *newnode = (struct node }
*)malloc(sizeof(struct node));
struct node *temp = head;
newnode->data = val;
head = head->next;
if (loc == 1) {
if (head != NULL)
newnode->next = head;
head->prev = NULL;
newnode->prev = NULL;
free(temp);
if (head != NULL)
}
head->prev = newnode;
void deE() {
head = newnode;
if (head == NULL) {
return;
printf("Empty List\n");
}
return;
struct node *temp = head;
}
for (int i = 1; i < loc - 1; i++) {
struct node *temp = head;
temp = temp->next;
if (head->next == NULL) {
head = NULL; }
} else { void dis() {
while (temp->next != NULL) if (head == NULL) {
temp = temp->next; printf("Empty List\n");
temp->prev->next = NULL; } else {
} struct node *temp = head;
free(temp); printf("List: NULL<---");
} while (temp != NULL) {
void deS(int loc) { printf("%d", temp->data);
if (head == NULL) { if (temp->next != NULL)
printf("Empty List\n"); printf("<===>");
return; temp = temp->next;
} }
struct node *temp = head; printf("--->NULL\n");
if (loc == 1) { }
head = temp->next; }
if (head != NULL)
head->prev = NULL;
free(temp);
return;
}
for (int i = 1; i < loc; i++) {
temp = temp->next;
if (temp == NULL) {
printf("Invalid location. The position is beyond
the list length.\n");
return;
}
}
if (temp->next != NULL)
temp->next->prev = temp->prev;
if (temp->prev != NULL)
temp->prev->next = temp->next;
free(temp);
You might also like
Puttin - On - The - Ritz Brass Quintet
PDF
100% (3)
Puttin - On - The - Ritz Brass Quintet
22 pages
Dsa
PDF
No ratings yet
Dsa
13 pages
DS Polynomial Addition
PDF
No ratings yet
DS Polynomial Addition
13 pages
Chapter 15-BOM
PDF
No ratings yet
Chapter 15-BOM
12 pages
DLL Matatag Week 5 Pe and Health
PDF
No ratings yet
DLL Matatag Week 5 Pe and Health
14 pages
Exploring Social Psychology 8th Edition Myers Full Download
PDF
No ratings yet
Exploring Social Psychology 8th Edition Myers Full Download
405 pages
CLL
PDF
No ratings yet
CLL
9 pages
Doubly Linked List
PDF
No ratings yet
Doubly Linked List
11 pages
Grab The Full PDF Version of Test Bank For Human Physiology: An Integrated Approach, 8th Edition, Dee Unglaub Silverthorn, With A Fast Download.
PDF
100% (6)
Grab The Full PDF Version of Test Bank For Human Physiology: An Integrated Approach, 8th Edition, Dee Unglaub Silverthorn, With A Fast Download.
72 pages
ANT-A114518R1v06-4261 Datasheet
PDF
No ratings yet
ANT-A114518R1v06-4261 Datasheet
4 pages
Microsoft Powerpoint Tips and Tricks
PDF
No ratings yet
Microsoft Powerpoint Tips and Tricks
8 pages
Lab 8
PDF
No ratings yet
Lab 8
8 pages
DS LAB Manual R22
PDF
No ratings yet
DS LAB Manual R22
90 pages
Anne Enright
PDF
No ratings yet
Anne Enright
4 pages
DSLAB
PDF
No ratings yet
DSLAB
49 pages
DS Prgms
PDF
No ratings yet
DS Prgms
62 pages
DynaMed Plus - Thyroid Nodule
PDF
No ratings yet
DynaMed Plus - Thyroid Nodule
85 pages
Data Structures & Algorithms DA5: Lab Assessment-5
PDF
No ratings yet
Data Structures & Algorithms DA5: Lab Assessment-5
21 pages
Dsa Lab Assignment 06
PDF
No ratings yet
Dsa Lab Assignment 06
16 pages
Link List Program D
PDF
No ratings yet
Link List Program D
22 pages
DSA LAB ASSIGNMENT 06 - Removed
PDF
No ratings yet
DSA LAB ASSIGNMENT 06 - Removed
14 pages
Circular Singly Linked List and Poly Mul
PDF
No ratings yet
Circular Singly Linked List and Poly Mul
9 pages
Dsa Asses4
PDF
No ratings yet
Dsa Asses4
17 pages
Sexual Sounds Can Trigger Porn Filter
PDF
No ratings yet
Sexual Sounds Can Trigger Porn Filter
1 page
B - CSE Assignment
PDF
No ratings yet
B - CSE Assignment
11 pages
Linked
PDF
No ratings yet
Linked
7 pages
Linked C
PDF
No ratings yet
Linked C
8 pages
Ielts Speaking Part 2 - People - Tlinh Xinh
PDF
No ratings yet
Ielts Speaking Part 2 - People - Tlinh Xinh
17 pages
'Fabulous Five' Queens Educators Save The Day After Autistic Boy Goes Missing - NY Daily News
PDF
No ratings yet
'Fabulous Five' Queens Educators Save The Day After Autistic Boy Goes Missing - NY Daily News
6 pages
SLL Program
PDF
No ratings yet
SLL Program
11 pages
Program 4
PDF
No ratings yet
Program 4
18 pages
Code 10
PDF
No ratings yet
Code 10
8 pages
Linkedlist C
PDF
No ratings yet
Linkedlist C
7 pages
Assignment 6
PDF
No ratings yet
Assignment 6
6 pages
DLL
PDF
No ratings yet
DLL
5 pages
Experiment 10
PDF
No ratings yet
Experiment 10
6 pages
Circular SLL
PDF
No ratings yet
Circular SLL
5 pages
Dsaexp 5
PDF
No ratings yet
Dsaexp 5
6 pages
CYCLOPENTANE
PDF
No ratings yet
CYCLOPENTANE
2 pages
Annexure 9.13 - Spillway Pier, Breast Wall, Training Wall Solid Stresses
PDF
100% (1)
Annexure 9.13 - Spillway Pier, Breast Wall, Training Wall Solid Stresses
6 pages
Linked Lists
PDF
No ratings yet
Linked Lists
4 pages
Circular Linked List
PDF
No ratings yet
Circular Linked List
4 pages
DLL
PDF
No ratings yet
DLL
6 pages
Exercise 3
PDF
No ratings yet
Exercise 3
23 pages
Harshit Sinha: Deloitte Financial Advisory Services India Private Limited (USI)
PDF
No ratings yet
Harshit Sinha: Deloitte Financial Advisory Services India Private Limited (USI)
1 page
SLL
PDF
No ratings yet
SLL
5 pages
Data Structure Code 2
PDF
No ratings yet
Data Structure Code 2
28 pages
Breadth First Search
PDF
No ratings yet
Breadth First Search
40 pages
Ticketcreator Barcodechecker Manual: Check Secure Tickets With Barcodes
PDF
No ratings yet
Ticketcreator Barcodechecker Manual: Check Secure Tickets With Barcodes
8 pages
DS Labmanual
PDF
No ratings yet
DS Labmanual
34 pages
A69 DS Ass10
PDF
No ratings yet
A69 DS Ass10
23 pages
Linked List Prgrams
PDF
No ratings yet
Linked List Prgrams
4 pages
Manual: Original Instructions Ver D
PDF
100% (3)
Manual: Original Instructions Ver D
95 pages
Answer-Past Paper Qs-Topic 1 and Topic 2
PDF
No ratings yet
Answer-Past Paper Qs-Topic 1 and Topic 2
2 pages
Grade 9 English 6 T
PDF
No ratings yet
Grade 9 English 6 T
2 pages
Hydraulic Diagram MM0434313 - 1
PDF
100% (1)
Hydraulic Diagram MM0434313 - 1
4 pages
Linked List Programs (Single, Double, Circular)
PDF
No ratings yet
Linked List Programs (Single, Double, Circular)
16 pages
Linkeslist in C
PDF
No ratings yet
Linkeslist in C
6 pages
DS Assignment 3
PDF
No ratings yet
DS Assignment 3
5 pages
New Bunawan
PDF
No ratings yet
New Bunawan
7 pages
DSA Using C
PDF
No ratings yet
DSA Using C
52 pages
4 Linkedlist
PDF
No ratings yet
4 Linkedlist
7 pages
Chapter 2 - Highway Materials
PDF
No ratings yet
Chapter 2 - Highway Materials
50 pages
DS Programs
PDF
No ratings yet
DS Programs
13 pages
Doublylinked List Operations
PDF
No ratings yet
Doublylinked List Operations
31 pages
Maruti Dealers PDF
PDF
No ratings yet
Maruti Dealers PDF
8 pages
LAB SDA N2 Revenko Ivan-1
PDF
No ratings yet
LAB SDA N2 Revenko Ivan-1
7 pages
Phil Iri English Automated - Innovation
PDF
100% (1)
Phil Iri English Automated - Innovation
24 pages
CTSD C03 &co4
PDF
No ratings yet
CTSD C03 &co4
38 pages
DS Lab PGM
PDF
No ratings yet
DS Lab PGM
43 pages
Dsa Ela Da 2
PDF
No ratings yet
Dsa Ela Da 2
19 pages
Dsa CH 3 Program
PDF
No ratings yet
Dsa CH 3 Program
12 pages
CS162 - 1
PDF
No ratings yet
CS162 - 1
22 pages
SLL ProgramFunctions
PDF
No ratings yet
SLL ProgramFunctions
10 pages
DSA Assignment
PDF
No ratings yet
DSA Assignment
8 pages
Doubly Linked List
PDF
No ratings yet
Doubly Linked List
6 pages
Blank
PDF
No ratings yet
Blank
3 pages
11
PDF
No ratings yet
11
4 pages
In Pursuit of Excellence For A Better Tomorrow
PDF
No ratings yet
In Pursuit of Excellence For A Better Tomorrow
26 pages
8,9,10,11 Acc Codes
PDF
No ratings yet
8,9,10,11 Acc Codes
7 pages
Data Structures & Algorithms Lab
PDF
No ratings yet
Data Structures & Algorithms Lab
51 pages
Division of Negros Occidental
PDF
No ratings yet
Division of Negros Occidental
5 pages
Double LL Ins, Del
PDF
No ratings yet
Double LL Ins, Del
3 pages
Fire Fighter
PDF
No ratings yet
Fire Fighter
3 pages
2021 Spring
PDF
No ratings yet
2021 Spring
12 pages
Lesson Plan: Headings Matter & Method Board
PDF
No ratings yet
Lesson Plan: Headings Matter & Method Board
3 pages
Nashik Car Deler List
PDF
No ratings yet
Nashik Car Deler List
8 pages
Project Report On - HRM IN AN ORGANIZATIONS
PDF
No ratings yet
Project Report On - HRM IN AN ORGANIZATIONS
17 pages