what is wrong with my code
Insertion at head
it is giving compilation error
just define a constructor in ur class
is it necessary to define a constructor?
no not necessary ,
but because here u r passing data in constructor ,it is mandatory
temp->data = data;
can we write like this?
yeah… … … …