OSDN Git Service

Update persistent-heap.md
author雷蒻 <34390285+hsfzLZH1@users.noreply.github.com>
Sun, 21 Jul 2019 05:38:21 +0000 (13:38 +0800)
committerGitHub <noreply@github.com>
Sun, 21 Jul 2019 05:38:21 +0000 (13:38 +0800)
更改代码实现与算法流程中的描述相同

docs/ds/persistent-heap.md

index 931d579..119df97 100644 (file)
@@ -37,7 +37,7 @@
 ```cpp
 int merge(int x, int y) {
   if (!x || !y) return x + y;
-  if (v[x] < v[y]) swap(x, y);
+  if (v[x] > v[y]) swap(x, y);
   int p = ++cnt;
   lc[p] = lc[x];
   v[p] = v[x];