#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() { ...
-
using namespace std; #include<stdio.h> #define N 5 class q{ public: int* arr; int front; int rear; q() { ...
-
#include<stdio.h> int fnCmp(char* str1, char* str2) { while( (*str1 != '\0' && *str2 != '\0') && ...
-
#include<stdio.h> void fncpy(char* str2, char* str1) { int i = 0; while(*str1 != '\0') { str2[i] = *str1; ...
No comments:
Post a Comment