Guest User

Untitled

a guest
May 16th, 2022
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. void Delete(int n)
  2. {
  3.     struct node **pp = &head;
  4.     for (int i=1; i<n && *pp; ++i)
  5.         pp = &(*pp)->next;
  6.  
  7.     if (*pp)
  8.     {
  9.         struct node *p = *pp;
  10.         *pp = p->next;
  11.         free(p);
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment