Search Results

Search found 1 results on 1 pages for 'emkrish'.

Page 1/1 | 1 

  • Copy a linked list

    - by emkrish
    typedef struct Node { int data; Node *next; Node *other; }; Node *pHead; pHead is a singly linked list. The next field points to the next element in the list. The other field may point to any other element (could be one of the previous nodes or one of the nodes ahead) in the list or NULL. How does one write a copy function that duplicates the linked list and its connectivity? None of the elements (next and other) in the new list should point to any element in the old list.

    Read the article

1