Insert a Node at the Tail of a Linked List

  • + 1 comment

    According to the problem statement... 1.)You need to figure out a way if head=NULL i.e if the list is empty but when you declare "if(head->next==NULL)" it means that you are consider only the non empty case. 2.)Even in this above case you are just returning "newn" nut you need to return thr address of first node which is "head"!

    try adding if(head==NULL) block of statements also