forked from sanjeevmishra391/DataStructure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinkList.c
More file actions
46 lines (29 loc) · 745 Bytes
/
Copy pathlinkList.c
File metadata and controls
46 lines (29 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include <stdlib.h>
// defining the structure
struct new_node {
int data;
struct new_node* nxt;
};
//<<<<<<< master
//main coding part
//Main method srarts
//>>>>>>> master
int main()
{
struct new_node* head = NULL;
struct new_node* second = NULL;
struct new_node* third = NULL;
// allocate 3 new_nodes in the heap
head = (struct new_node*)malloc(sizeof(struct new_node));
second = (struct new_node*)malloc(sizeof(struct new_node));
third = (struct new_node*)malloc(sizeof(struct new_node));
head->data = 1;
head->nxt = second;
second->data = 2;
second->nxt = third;
third->data = 3;
third->nxt = NULL;
return 0;
//please add this pr
}