#include<stdio.h>
struct tag {
int x;
struct tag *Next;
};
void showMe(struct tag *n) {
while(n!=NULL) {
printf("%d\n", n->x);
n = n->Next;
}
}
int main() {
struct tag x, *t1, y , *t2, z, *t3;
t1 = &x;
t2 = &y;
t3 = &z;
t1->x = 1;
t1->Next = &y;
t2->x = 2;
t2->Next = &z;
t3->x = 3;
t3->Next = NULL;
showMe(&x);
return 0;
}
Monday, November 1, 2021
Linked list in C Data Structure
Subscribe to:
Post Comments (Atom)
Priority queue deleting elements after ascending inputs Gaand Fadd
using namespace std; #include<iostream> #define N 5 class pq { public: int* arr; int front; int rear; pq() { ...
-
//See sabse pehle ek khali node bana lena jiska prev and next null ho uske bad use return kar le fir saare operation perform kar lena //Tim...
-
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; void add(struct node** tail, int val...
-
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; void inElFr(struct node** head, int ...
No comments:
Post a Comment