initial segmenttree visual: drawing a binary tree
This commit is contained in:
parent
39684289b0
commit
3c5e3e1fbe
|
@ -0,0 +1,13 @@
|
|||
from manim import *
|
||||
|
||||
import networkx as nx
|
||||
|
||||
class Tree(Scene):
|
||||
def construct(self):
|
||||
vertices = list(range(1, 25))
|
||||
edges = []
|
||||
for v in vertices[1:]:
|
||||
edges.append((v // 2, v))
|
||||
|
||||
self.play(Create(Graph(vertices, edges, labels=True, layout="tree", layout_config={"vertex_spacing": (1.0, 1.0)}, root_vertex=1)))
|
||||
self.wait(2)
|
Loading…
Reference in New Issue