Showing posts with label copy link list. Show all posts
Showing posts with label copy link list. Show all posts

Wednesday, April 27, 2011

How to create a copy of a linked list?

linked_lists_copy(struct data_node *q, struct data_node **s) {
    if(q!=NULL)
    {
        *s=malloc(sizeof(struct data_node))
        (*s)->data=q->data;
        (*s)->link=NULL;
        linked_lists_copy(q->link, &((*s)->link));
    } }

Featured Posts

Kali Linux Remote Desktop: Access GNOME from Windows Using Native RDP

  Kali Linux + GNOME 50 + GNOME Remote Desktop + Windows Remote Desktop (MSTSC) Getting a full GNOME desktop remotely on Kali Linux can be ...