MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

data_structures/binary_tree/segment_tree.py:5–12  ·  view source on GitHub ↗
(self, a)

Source from the content-addressed store, hash-verified

3
4class SegmentTree:
5 def __init__(self, a):
6 self.A = a
7 self.N = len(self.A)
8 self.st = [0] * (
9 4 * self.N
10 ) # approximate the overall size of segment tree with array N
11 if self.N:
12 self.build(1, 0, self.N - 1)
13
14 def left(self, idx):
15 """

Callers

nothing calls this directly

Calls 1

buildMethod · 0.95

Tested by

no test coverage detected