0

I m a beginner in data structures and I started with linked list! Help me what are the mistakes in this code, post yrs for refer

https://code.sololearn.com/cY4qcKVgYUYY/?ref=app

14th Oct 2019, 2:47 AM
Captain X
Captain X - avatar
3 Respuestas
+ 4
you have not printed anything using cout ... so there is nothing to display but no output suggest that code is compiled without error
15th Oct 2019, 3:53 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 3
Captain X it should be NULL instead of Null... one more issue was there on usage of new which I mentioned with below code as comment of the statement for new Node *head = NULL; //global variable Node *ptr = new Node();//here also, only ptr variable is enough...you were doing ptr-> which is not correct ptr->link=NULL;
14th Oct 2019, 2:54 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Shld it show no Output?
15th Oct 2019, 3:49 AM
Captain X
Captain X - avatar