two lists are same or not

write a recursive program to check if two lists are same or not.

Comments

  1. int check(struct node* list1,struct node* list2)
    {
    if(list1 == NULL && list2 == NULL)
    return 1;
    else{
    if(list1 == NULL || list2 == NULL)
    return 0;
    else if(list1->data != list2->data)
    return 0;
    else
    return(check(list1->data,list2->data));
    }

    ReplyDelete

Post a Comment

Popular posts from this blog