using namespace std;
#include<iostream>
class Node {
public:
int Value;
Node* Next;
};
void print_node(Node* n) {
while (n!=NULL) {
cout << n->Value << endl;
n = n->Next;
}
}
int main() {
Node* head = new Node();
Node* second = new Node();
Node* third = new Node();
head->Value = 1;
head->Next = second;
second->Value = 2;
second->Next = third;
third->Value = 3;
third->Next = NULL;
print_node(head);
system("pause > 0");
return 0;
}
Monday, November 1, 2021
Linked List 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