# SegmentTree | data-structure-typed
Documentation for data-structure-typed

# Class SegmentTree

#### Hierarchy

- SegmentTree

- Defined in src/data-structures/binary-tree/segment-tree.ts:77

#####
Index

### Constructors

constructor

### Properties

_end
_root
_start
_values

### Accessors

root

### Methods

build
querySumByRange
updateNode

## Constructors

### constructor

- new SegmentTree(values, start?, end?): SegmentTree

- #### Parameters

  - ##### values: number[]

  - ##### `Optional` start: number

  - ##### `Optional` end: number

  #### Returns SegmentTree

  - Defined in src/data-structures/binary-tree/segment-tree.ts:82

## Properties

### `Protected` _end

_end: number

- Defined in src/data-structures/binary-tree/segment-tree.ts:80

### `Protected` _root

_root: null | SegmentTreeNode

- Defined in src/data-structures/binary-tree/segment-tree.ts:91

### `Protected` _start

_start: number = 0

- Defined in src/data-structures/binary-tree/segment-tree.ts:79

### `Protected` _values

_values: number[] = []

- Defined in src/data-structures/binary-tree/segment-tree.ts:78

## Accessors

### root

- get root(): null | SegmentTreeNode

- #### Returns null | SegmentTreeNode

  - Defined in src/data-structures/binary-tree/segment-tree.ts:93

## Methods

### build

- build(start, end): SegmentTreeNode

- #### Parameters

  - ##### start: number

  - ##### end: number

  #### Returns SegmentTreeNode

  - Defined in src/data-structures/binary-tree/segment-tree.ts:97

### querySumByRange

- querySumByRange(indexA, indexB): number

- #### Parameters

  - ##### indexA: number

  - ##### indexB: number

  #### Returns number

  - Defined in src/data-structures/binary-tree/segment-tree.ts:139

### updateNode

- updateNode(index, sum, val?): void

- #### Parameters

  - ##### index: number

  - ##### sum: number

  - ##### `Optional` val: number

  #### Returns void

  - Defined in src/data-structures/binary-tree/segment-tree.ts:110

Generated using TypeDoc