Skip to content

Commit

Permalink
linked list
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoMeza committed May 1, 2019
1 parent ebd07c6 commit 4e2c3ea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions linked-list.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
vector<int> nxt, prv;
void list_init(int n) {
nxt.clear(); nxt.assign(n+1,n);
prv.clear(); prv.assign(n+1,n);
}
void list_erase(int node) {
nxt[prv[node]] = nxt[node];
prv[nxt[node]] = prv[node];
}

0 comments on commit 4e2c3ea

Please sign in to comment.