Lec 5 | Double Circular Linked List | Search | Data Structures | C programming
@VimalKaushik-g3t Please Like, Share, and Subscribe. If any doubts or feedback, please comment below. In this video, we discussed about 1. Introduction to double circular linked list 2. Searching in a doubly circular linked list Here is the C program for it, #include (less than symbol)stdio.h(greater than symbol) #include (less than symbol)stdlib.h(greater than symbol) typedef struct dblcrl { struct dblcrl *plink; int data; struct dblcrl *nlink; }dblcrl; dblcrl *start = NULL, *last, *temp; int n, key, elm, pos; int main() { void create(); void display(); void insert(); void search(); int ch; while(1) { printf("1. Create\n"); printf("2. Display\n"); printf("3. Insert\n"); printf("5. Search\n"); printf("6. Exit\n"); printf("Enter your choice: "); scanf("%d",&ch); switch(ch) { case 1 : create(); break; case 2 : display(); break; case 3 : insert(); break; case 5 : search(); break; case 6 : exit(0); break; default: printf("Invalid Number\n"); } } return 0; } void create() { start = NULL; printf("Enter the total number of elements : "); scanf("%d",&n); printf("Enter the elements: \n"); for(int i = 0 ; i (less than symbol) n ; i++) { temp = (dblcrl*)malloc(sizeof(dblcrl)); scanf("%d",&temp- (greater than symbol)data); temp- (greater than symbol)plink = NULL; temp- (greater than symbol)nlink = NULL; if(start == NULL) { start = temp; last = temp; start- (greater than symbol)plink = last; last- (greater than symbol)nlink = start; } else { temp- (greater than symbol)plink = last; temp- (greater than symbol)nlink = start; last- (greater than symbol)nlink = temp; start- (greater than symbol)plink = temp; last = temp; } } printf("%d elements created successfully.\n",n); } void display() { if(start == NULL) { printf("List is empty\n"); return; } temp = start; do { printf("%d ", temp- (greater than symbol)data); temp = temp- (greater than symbol)nlink; } while(temp != start); printf("\n"); } void insert() { if(start == NULL) { printf("List is empty\n"); return; } repeat: printf("Enter position to insert: "); scanf("%d",&pos); if(pos (less than symbol) 1 || pos (greater than symbol) n+1) { printf("Enter a valid position to insert\n"); goto repeat; } temp = (dblcrl*)malloc(sizeof(dblcrl)); scanf("%d",&temp- (greater than symbol)data); temp- (greater than symbol)plink = NULL; temp- (greater than symbol)nlink = NULL; if(pos == 1) { temp- (greater than symbol)plink = last; temp- (greater than symbol)nlink = start; start- (greater than symbol)plink = temp; last- (greater than symbol)nlink = temp; start = temp; } else if(pos == n+1) { temp- (greater than symbol)plink = last; temp- (greater than symbol)nlink = start; last- (greater than symbol)nlink = temp; start- (greater than symbol)plink = temp; last = temp; } else { dblcrl *ins = start; for(int i = 1 ; i (less than symbol) pos-1 ; i++) { ins = ins- (greater than symbol)nlink; } temp- (greater than symbol)plink = ins; temp- (greater than symbol)nlink = ins- (greater than symbol)nlink; ins- (greater than symbol)nlink- (greater than symbol)plink = temp; ins- (greater than symbol)nlink = temp; } n++; printf("%d inserted successfully at position %d\n", temp- (greater than symbol)data, pos); } void search() { if(start == NULL) { printf("List is empty\n"); return; } int key, flag = 0, pos = 0; temp = start; printf("Enter the element to search: "); scanf("%d",&key); do { if(temp- (greater than symbol)data == key) { printf("%d found at %d\n",key,pos); flag = 1; } pos++; temp = temp- (greater than symbol)nlink; }while(temp != start); if(flag == 0) { printf("%d not found\n",key); } }

Lec 4 | Double Circular Linked List | Delete | Data Structures | C programming

Scott Ritter: Russland gewinnt den Krieg – und das eindeutig

China Is About To Pop The AI Bubble

Mr.Bean Making Celebrities Cry With Laughter NONSTOP!

The let-expression in Power Query M Explained

Data Structure and Algorithm Patterns for LeetCode Interviews – Tutorial

SMART GADGETS THAT WILL UPGRADE YOUR LIFE!

Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)

The Scariest Chart In Electrical Engineering

Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF

I Taught Myself C By Rejecting Modern Tech

Lec 1 | Double Circular Linked List | Creation | Data Structures | C programming

🚗 BYD : The biggest SCAM of the car industry ?

He Risked Everything To Warn You: No One Is Ready For What's Coming, And The AI Companies Know It!

Postgres does everything now...

Don't Throw Away Your Old Computer Hard Drive 😱 Billions of People Don't Know This Secret

Typical Soviet Apartment Tour (How Russian People REALLY Live)

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

Is Russia Actually Losing?

