diff options
| author | Noobie99 <noob999noob999@gmail.com> | 2023-02-04 17:08:20 +0100 |
|---|---|---|
| committer | Noobie99 <noob999noob999@gmail.com> | 2023-02-04 17:08:20 +0100 |
| commit | 36b13e20dd5d734fb904ee3a7ba1a1ec50d6c8b1 (patch) | |
| tree | 696e646324377e80dbc639ec945f05e2c20638b8 /datastructures/treap2.cpp | |
| parent | 63b53894683dc5a9d89ecc4ab45bb25faafd770a (diff) | |
rename variable sz to size
Diffstat (limited to 'datastructures/treap2.cpp')
| -rw-r--r-- | datastructures/treap2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/datastructures/treap2.cpp b/datastructures/treap2.cpp index e0c32a6..5d0aefa 100644 --- a/datastructures/treap2.cpp +++ b/datastructures/treap2.cpp @@ -2,7 +2,7 @@ mt19937 rng(0xc4bd5dad); struct Treap { struct Node { ll val; - int prio, sz = 1, l = -1, r = -1; + int prio, size = 1, l = -1, r = -1; Node (ll x) : val(x), prio(rng()) {} }; @@ -10,13 +10,13 @@ struct Treap { int root = -1; int getSize(int v) { - return v < 0 ? 0 : treap[v].sz; + return v < 0 ? 0 : treap[v].size; } void upd(int v) { if (v < 0) return; auto *V = &treap[v]; - V->sz = 1 + getSize(V->l) + getSize(V->r); + V->size = 1 + getSize(V->l) + getSize(V->r); // Update Node Code } |
