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

# Class TreeNode<T>

#### Type Parameters

- #### T = any

#### Hierarchy

- TreeNode

- Defined in src/data-structures/tree/tree.ts:1

#####
Index

### Constructors

constructor

### Properties

_children?
_id
_value?

### Accessors

children
id
value

### Methods

addChildren
getHeight

## Constructors

### constructor

- new TreeNode<T>(id, value?, children?): TreeNode <T>

- #### Type Parameters

  - #### T = any

  #### Parameters

  - ##### id: string

  - ##### `Optional` value: T

  - ##### `Optional` children: TreeNode <T>[]

  #### Returns TreeNode <T>

  - Defined in src/data-structures/tree/tree.ts:2

## Properties

### `Private` `Optional` _children

_children?: TreeNode <T>[]

- Defined in src/data-structures/tree/tree.ts:28

### `Private` _id

_id: string

- Defined in src/data-structures/tree/tree.ts:8

### `Private` `Optional` _value

_value?: T

- Defined in src/data-structures/tree/tree.ts:18

## Accessors

### children

- get children(): undefined | TreeNode <T>[]

- #### Returns undefined | TreeNode <T>[]

  - Defined in src/data-structures/tree/tree.ts:30
- set children(value): void

- #### Parameters

  - ##### value: undefined | TreeNode <T>[]

  #### Returns void

  - Defined in src/data-structures/tree/tree.ts:34

### id

- get id(): string

- #### Returns string

  - Defined in src/data-structures/tree/tree.ts:10
- set id(value): void

- #### Parameters

  - ##### value: string

  #### Returns void

  - Defined in src/data-structures/tree/tree.ts:14

### value

- get value(): undefined | T

- #### Returns undefined | T

  - Defined in src/data-structures/tree/tree.ts:20
- set value(value): void

- #### Parameters

  - ##### value: undefined | T

  #### Returns void

  - Defined in src/data-structures/tree/tree.ts:24

## Methods

### addChildren

- addChildren(children): void

- #### Parameters

  - ##### children: TreeNode <T> | TreeNode <T>[]

  #### Returns void

  - Defined in src/data-structures/tree/tree.ts:38

### getHeight

- getHeight(): number

- #### Returns number

  - Defined in src/data-structures/tree/tree.ts:49

Generated using TypeDoc