From e47a3609383276f25dd1155dc8726cd612779f33 Mon Sep 17 00:00:00 2001 From: divya116 <56511764+divya116@users.noreply.github.com> Date: Wed, 16 Oct 2019 11:09:36 +0530 Subject: [PATCH] Create Linked List Creation --- Data Structures/Linked List Creation | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Data Structures/Linked List Creation diff --git a/Data Structures/Linked List Creation b/Data Structures/Linked List Creation new file mode 100644 index 0000000..4b0e775 --- /dev/null +++ b/Data Structures/Linked List Creation @@ -0,0 +1,33 @@ +#include +using namespace std; + +class Node +{ +public: + int data; + Node* next; +}; + +int main() +{ + Node* head = NULL; + Node* second = NULL; + Node* third = NULL; + + head = new Node(); + second = new Node(); + third = new Node(); + + head->data = 1; + head->next = second; + + second->data = 2; + + second->next = third; + + + third->data = 3; + third->next = NULL; + + return 0; +}