We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52ac69d commit cf4ff1aCopy full SHA for cf4ff1a
1 file changed
pyperformance/data-files/benchmarks/bm_btree/run_benchmark.py
@@ -133,6 +133,24 @@ def get_level(self):
133
else:
134
return 1 + self.nodes[0].get_level()
135
136
+ def get_min_item(self):
137
+ """() -> (key:anything, value:anything)
138
+ Return the item with the minimal key.
139
+ """
140
+ if self.is_leaf():
141
+ return self.items[0]
142
+ else:
143
+ return self.nodes[0].get_min_item()
144
+
145
+ def get_max_item(self):
146
147
+ Return the item with the maximal key.
148
149
150
+ return self.items[-1]
151
152
+ return self.nodes[-1].get_max_item()
153
154
def delete(self, key):
155
"""(key:anything)
156
Delete the item with this key.
0 commit comments