rornoanparn

Untitled

Feb 26th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. void insertFirst(List &L, address P) {
  2.     Q = first(L);
  3.     while ( next(Q) != first (L) ){
  4.         Q = next(Q);
  5.     }
  6.     next(Q) = P;
  7.     next(P) = first(L);
  8.     prev(P) = Q;
  9.     prev(Q) = P;
  10.     first(L) = P;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment