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 now
Download
Save Doubly linked list For Later
Download
Save
Save Doubly linked list For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
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
Download now
Download
Save Doubly linked list For Later
Carousel Previous
Carousel Next
Download
Save
Save Doubly linked list For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
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
Guide To Auditing IFRS 9 Expected Credit Loss
PDF
100% (4)
Guide To Auditing IFRS 9 Expected Credit Loss
75 pages
NRCC Letter
PDF
No ratings yet
NRCC Letter
2 pages
Fast Numerical Simulation For Full Bore Rupture of Pressurized Pipelines
PDF
100% (1)
Fast Numerical Simulation For Full Bore Rupture of Pressurized Pipelines
11 pages
Circular Linked List
PDF
No ratings yet
Circular Linked List
4 pages
DS Prgms
PDF
No ratings yet
DS Prgms
62 pages
DS_labmanual
PDF
No ratings yet
DS_labmanual
34 pages
Linked Lists
PDF
No ratings yet
Linked Lists
4 pages
LAB SDA N2 Revenko Ivan-1
PDF
No ratings yet
LAB SDA N2 Revenko Ivan-1
7 pages
dll
PDF
No ratings yet
dll
5 pages
Linkeslist in c
PDF
No ratings yet
Linkeslist in c
6 pages
160123735197
PDF
No ratings yet
160123735197
40 pages
Program 4
PDF
No ratings yet
Program 4
18 pages
DS Lab PGM
PDF
No ratings yet
DS Lab PGM
43 pages
8,9,10,11 ACC CODES
PDF
No ratings yet
8,9,10,11 ACC CODES
7 pages
Dsa Lab Assignment 06
PDF
No ratings yet
Dsa Lab Assignment 06
16 pages
SLL
PDF
No ratings yet
SLL
5 pages
Dsa CH 3 Program
PDF
No ratings yet
Dsa CH 3 Program
12 pages
Linkedlist C
PDF
No ratings yet
Linkedlist C
7 pages
DS LAB Manual R22
PDF
No ratings yet
DS LAB Manual R22
90 pages
Experiment 10
PDF
No ratings yet
Experiment 10
6 pages
DSA LAB ASSIGNMENT 06_removed
PDF
No ratings yet
DSA LAB ASSIGNMENT 06_removed
14 pages
linked.c
PDF
No ratings yet
linked.c
8 pages
CIRCULAR_SLL
PDF
No ratings yet
CIRCULAR_SLL
5 pages
DSA Using C
PDF
No ratings yet
DSA Using C
52 pages
Assignment 6
PDF
No ratings yet
Assignment 6
6 pages
2012020088_B_CSE assignment
PDF
No ratings yet
2012020088_B_CSE assignment
11 pages
Linked List Prgrams
PDF
No ratings yet
Linked List Prgrams
4 pages
A69 DS Ass10
PDF
No ratings yet
A69 DS Ass10
23 pages
SLL_ProgramFunctions
PDF
No ratings yet
SLL_ProgramFunctions
10 pages
202411005_ CS162_1
PDF
No ratings yet
202411005_ CS162_1
22 pages
CLL
PDF
No ratings yet
CLL
9 pages
Link List Program D
PDF
No ratings yet
Link List Program D
22 pages
Doublylinked List Operations
PDF
No ratings yet
Doublylinked List Operations
31 pages
DLL
PDF
No ratings yet
DLL
6 pages
DATA STRUCTURE CODE 2
PDF
No ratings yet
DATA STRUCTURE CODE 2
28 pages
SLL Program
PDF
No ratings yet
SLL Program
11 pages
Circular Singly Linked List and Poly Mul
PDF
No ratings yet
Circular Singly Linked List and Poly Mul
9 pages
CTSD C03 &co4
PDF
No ratings yet
CTSD C03 &co4
38 pages
Code 10
PDF
No ratings yet
Code 10
8 pages
Data Structures & Algorithms DA5: Lab Assessment-5
PDF
No ratings yet
Data Structures & Algorithms DA5: Lab Assessment-5
21 pages
Double LL Ins, Del
PDF
No ratings yet
Double LL Ins, Del
3 pages
Doubly Linked List
PDF
No ratings yet
Doubly Linked List
11 pages
Linked List Programs (Single, Double, Circular)
PDF
No ratings yet
Linked List Programs (Single, Double, Circular)
16 pages
DSA Assignment
PDF
No ratings yet
DSA Assignment
8 pages
DS Polynomial Addition
PDF
No ratings yet
DS Polynomial Addition
13 pages
Lab 8
PDF
No ratings yet
Lab 8
8 pages
Exercise 3
PDF
No ratings yet
Exercise 3
23 pages
4 Linkedlist
PDF
No ratings yet
4 Linkedlist
7 pages
Dsa Ela Da 2
PDF
No ratings yet
Dsa Ela Da 2
19 pages
DS Programs
PDF
No ratings yet
DS Programs
13 pages
Dsa Asses4
PDF
No ratings yet
Dsa Asses4
17 pages
Data Structures & Algorithms Lab
PDF
No ratings yet
Data Structures & Algorithms Lab
51 pages
11
PDF
No ratings yet
11
4 pages
doubly linked list
PDF
No ratings yet
doubly linked list
6 pages
DSLAB
PDF
No ratings yet
DSLAB
49 pages
DS Assignment 3
PDF
No ratings yet
DS Assignment 3
5 pages
2021_spring
PDF
No ratings yet
2021_spring
12 pages
Dsaexp 5
PDF
No ratings yet
Dsaexp 5
6 pages
Blank
PDF
No ratings yet
Blank
3 pages
Chrisfred Assignment
PDF
No ratings yet
Chrisfred Assignment
7 pages
CLL
PDF
No ratings yet
CLL
6 pages
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet
PHP programming
From Everand
PHP programming
Nino Paiotta
No ratings yet
EC Edible Oil Industrial Park Zaheerabad
PDF
No ratings yet
EC Edible Oil Industrial Park Zaheerabad
4 pages
P15.4 MOTOR EFFECT
PDF
No ratings yet
P15.4 MOTOR EFFECT
33 pages
Volume Ii Employers Requirements Technical Specifications Minigrids Kosap KPLC
PDF
No ratings yet
Volume Ii Employers Requirements Technical Specifications Minigrids Kosap KPLC
207 pages
ISTA as Shop Manual
PDF
No ratings yet
ISTA as Shop Manual
12 pages
Online Case Referencing II Sem LLM, Qs
PDF
No ratings yet
Online Case Referencing II Sem LLM, Qs
4 pages
BTW Sor (Fy10)
PDF
No ratings yet
BTW Sor (Fy10)
236 pages
Setting Up Active Directory
PDF
No ratings yet
Setting Up Active Directory
2 pages
G6 Q2 PT Math
PDF
No ratings yet
G6 Q2 PT Math
8 pages
Python Lab
PDF
No ratings yet
Python Lab
27 pages
4.project Report
PDF
No ratings yet
4.project Report
38 pages
Western Guaranty v. CA 187 SCRA 652
PDF
No ratings yet
Western Guaranty v. CA 187 SCRA 652
7 pages
AAA - CHAPTER 6 THE AUDIT APPROACH_watermark
PDF
No ratings yet
AAA - CHAPTER 6 THE AUDIT APPROACH_watermark
6 pages
Beamer User Guide, Latex
PDF
100% (1)
Beamer User Guide, Latex
247 pages
2nd Puc Bstud MQP
PDF
No ratings yet
2nd Puc Bstud MQP
4 pages
Partnership Formation and Operation.
PDF
No ratings yet
Partnership Formation and Operation.
4 pages
Acronyms
PDF
No ratings yet
Acronyms
6 pages
Architectural History-2: Comprehensive Architecture Licensure Examination Review + Preparation Program
PDF
No ratings yet
Architectural History-2: Comprehensive Architecture Licensure Examination Review + Preparation Program
6 pages
PDA Public Site Application TCs - ENG - Formatted
PDF
No ratings yet
PDA Public Site Application TCs - ENG - Formatted
5 pages
1994 Bounder
PDF
No ratings yet
1994 Bounder
52 pages
Price List
PDF
No ratings yet
Price List
194 pages
lolly
PDF
No ratings yet
lolly
2 pages
Add On Room Tutorial
PDF
No ratings yet
Add On Room Tutorial
30 pages
Account Closer Form TradeBulls
PDF
No ratings yet
Account Closer Form TradeBulls
1 page
BDA - Week04 - 10
PDF
No ratings yet
BDA - Week04 - 10
41 pages
The Mouse That Roared
PDF
No ratings yet
The Mouse That Roared
2 pages
Torrent Support
PDF
No ratings yet
Torrent Support
31 pages
A.s.dreyer@starmail - Co.za: Email
PDF
No ratings yet
A.s.dreyer@starmail - Co.za: Email
1 page