From 5421cfcdeb8d0e7b71611b511509f1dc1a2b70f5 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Sat, 31 Aug 2024 11:18:06 +0530 Subject: [PATCH] fix: add to treap.cpp --- data_structures/treap.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data_structures/treap.cpp b/data_structures/treap.cpp index 522876941..5be3b2416 100644 --- a/data_structures/treap.cpp +++ b/data_structures/treap.cpp @@ -19,6 +19,7 @@ #include /// For array #include /// For assert +#include /// for integral typedefs #include /// For IO operations /** @@ -157,11 +158,9 @@ struct Treap { } if (k == key[x]) { return size[childs[x][0]] + 1; - } - else if (k < key[x]) { + } else if (k < key[x]) { return _get_rank(childs[x][0], k); - } - else { + } else { return size[childs[x][0]] + cnt[x] + _get_rank(childs[x][1], k); } }