MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / construct

Method construct

animations/segmenttree.py:242–261  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

240
241
242 def construct(self):
243 self.start_logo(animate=False)
244 self.init_message("查询线段树")
245
246 self.tree = AlgoSegTree(self, self.datas).scale(0.9).shift(UP*0.5)
247 self.play(ShowCreation(self.tree))
248
249 for i in range(0, 1):
250 for j in range(i, 6):
251 for k in self.tree.arrows:
252 v = self.tree.arrows[k]
253 v.set_color("#6e6e6c")
254 for k in self.tree.node_objs:
255 v = self.tree.node_objs[k]
256 v.set_color("#6e6e6c")
257 self.show_message("查询区间[%d,%d]的和"%(i, j))
258 value = self.query(self.tree.root, i, j)
259 self.play(Uncreate(self.tree))
260 self.finish_scene("完成线段树,谢谢观看!")
261 self.wait(10)

Callers

nothing calls this directly

Calls 7

queryMethod · 0.95
AlgoSegTreeClass · 0.85
start_logoMethod · 0.80
init_messageMethod · 0.80
finish_sceneMethod · 0.80
scaleMethod · 0.45
show_messageMethod · 0.45

Tested by

no test coverage detected