From ca3750e6d72c67c564b6a71e1fd8c68b20b45a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 17 Apr 2022 13:56:44 +0200 Subject: [PATCH] fix bug in leaf function --- segment_tree.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/segment_tree.h b/segment_tree.h index 9abb318..d070556 100644 --- a/segment_tree.h +++ b/segment_tree.h @@ -100,8 +100,9 @@ bool TreeNode::covered() { } bool SegmentTree::is_leaf(Index node_idx) { - return node_idx > _num_meta_nodes; + return node_idx >= _num_meta_nodes; } + #endif //PROG_SEGMENT_TREE_H