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

# Interface IBST<N>

#### Type Parameters

- #### N extends BSTNode <N["val"], N>

#### Hierarchy

- IBinaryTree <N>
  - IBST
    - IAVLTree
    - IRBTree

#### Implemented by

- BST

- Defined in src/interfaces/bst.ts:7

#####
Index

### Accessors

loopType
root
size
visitedId
visitedLeftSum
visitedNode
visitedVal

### Methods

BFS
DFS
DFSIterative
add
addMany
allGreaterNodesAdd
clear
createNode
fill
get
getDepth
getHeight
getLeftMost
getMinHeight
getNodes
getPathToRoot
getPredecessor
getRightMost
getSubTreeSize
has
isAVLBalanced
isBST
isEmpty
isPerfectlyBalanced
isSubtreeBST
lastKey
lesserSum
levelIterative
listLevels
morris
perfectlyBalance
remove
subTreeAdd
subTreeSum
swapLocation

## Accessors

### loopType

- get loopType(): LoopType

- #### Returns LoopType

  Inherited from IBinaryTree.loopType

  - Defined in src/interfaces/abstract-binary-tree.ts:45

### root

- get root(): null | N

- #### Returns null | N

  Inherited from IBinaryTree.root

  - Defined in src/interfaces/abstract-binary-tree.ts:55

### size

- get size(): number

- #### Returns number

  Inherited from IBinaryTree.size

  - Defined in src/interfaces/abstract-binary-tree.ts:57

### visitedId

- get visitedId(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.visitedId

  - Defined in src/interfaces/abstract-binary-tree.ts:47

### visitedLeftSum

- get visitedLeftSum(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.visitedLeftSum

  - Defined in src/interfaces/abstract-binary-tree.ts:53

### visitedNode

- get visitedNode(): N[]

- #### Returns N[]

  Inherited from IBinaryTree.visitedNode

  - Defined in src/interfaces/abstract-binary-tree.ts:51

### visitedVal

- get visitedVal(): N["val"][]

- #### Returns N["val"][]

  Inherited from IBinaryTree.visitedVal

  - Defined in src/interfaces/abstract-binary-tree.ts:49

## Methods

### BFS

- BFS(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:113
- BFS(nodeOrPropertyName): number[]

- #### Parameters

  - ##### nodeOrPropertyName: "id"

  #### Returns number[]

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:115
- BFS(nodeOrPropertyName): N["val"][]

- #### Parameters

  - ##### nodeOrPropertyName: "val"

  #### Returns N["val"][]

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:117
- BFS(nodeOrPropertyName): N[]

- #### Parameters

  - ##### nodeOrPropertyName: "node"

  #### Returns N[]

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:119
- BFS(nodeOrPropertyName): number[]

- #### Parameters

  - ##### nodeOrPropertyName: "count"

  #### Returns number[]

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:121
- BFS(nodeOrPropertyName?): AbstractBinaryTreeNodeProperties <N>

- #### Parameters

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperties <N>

  Inherited from IBinaryTree.BFS

  - Defined in src/interfaces/abstract-binary-tree.ts:123

### DFS

- DFS(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:125
- DFS(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "id"

  #### Returns number[]

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:127
- DFS(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "val"

  #### Returns N[]

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:129
- DFS(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "node"

  #### Returns N[]

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:131
- DFS(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "count"

  #### Returns number[]

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:133
- DFS(pattern?, nodeOrPropertyName?): AbstractBinaryTreeNodeProperties <N>

- #### Parameters

  - ##### `Optional` pattern: "in" | "pre" | "post"

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperties <N>

  Inherited from IBinaryTree.DFS

  - Defined in src/interfaces/abstract-binary-tree.ts:135

### DFSIterative

- DFSIterative(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:137
- DFSIterative(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "id"

  #### Returns number[]

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:139
- DFSIterative(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "val"

  #### Returns N[]

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:141
- DFSIterative(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "node"

  #### Returns N[]

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:143
- DFSIterative(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "count"

  #### Returns number[]

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:145
- DFSIterative(pattern?, nodeOrPropertyName?): AbstractBinaryTreeNodeProperties <N>

- #### Parameters

  - ##### `Optional` pattern: "in" | "pre" | "post"

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperties <N>

  Inherited from IBinaryTree.DFSIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:147

### add

- add(id, val?, count?): undefined | null | N

- #### Parameters

  - ##### id: number

  - ##### `Optional` val: null | N["val"]

  - ##### `Optional` count: number

  #### Returns undefined | null | N

  Overrides IBinaryTree.add

  - Defined in src/interfaces/bst.ts:10

### addMany

- addMany(idsOrNodes, data?): (undefined | null | N)[]

- #### Parameters

  - ##### idsOrNodes: (null | number | N)[]

  - ##### `Optional` data: N["val"][]

  #### Returns (undefined | null | N)[]

  Inherited from IBinaryTree.addMany

  - Defined in src/interfaces/abstract-binary-tree.ts:67

### allGreaterNodesAdd

- allGreaterNodesAdd(node, delta, propertyName?): boolean

- #### Parameters

  - ##### node: N

  - ##### delta: number

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns boolean

  - Defined in src/interfaces/bst.ts:24

### clear

- clear(): void

- #### Returns void

  Inherited from IBinaryTree.clear

  - Defined in src/interfaces/abstract-binary-tree.ts:61

### createNode

- createNode(id, val?, count?): N

- #### Parameters

  - ##### id: number

  - ##### `Optional` val: N["val"]

  - ##### `Optional` count: number

  #### Returns N

  Overrides IBinaryTree.createNode

  - Defined in src/interfaces/bst.ts:8

### fill

- fill(idsOrNodes, data?): boolean

- #### Parameters

  - ##### idsOrNodes: (null | number | N)[]

  - ##### `Optional` data: N[] | N["val"][]

  #### Returns boolean

  Inherited from IBinaryTree.fill

  - Defined in src/interfaces/abstract-binary-tree.ts:69

### get

- get(nodeProperty, propertyName?): null | N

- #### Parameters

  - ##### nodeProperty: number | N

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns null | N

  Overrides IBinaryTree.get

  - Defined in src/interfaces/bst.ts:12

### getDepth

- getDepth(node): number

- #### Parameters

  - ##### node: N

  #### Returns number

  Inherited from IBinaryTree.getDepth

  - Defined in src/interfaces/abstract-binary-tree.ts:73

### getHeight

- getHeight(beginRoot?): number

- #### Parameters

  - ##### `Optional` beginRoot: null | N

  #### Returns number

  Inherited from IBinaryTree.getHeight

  - Defined in src/interfaces/abstract-binary-tree.ts:75

### getLeftMost

- getLeftMost(): null | N

- #### Returns null | N

  Inherited from IBinaryTree.getLeftMost

  - Defined in src/interfaces/abstract-binary-tree.ts:89
- getLeftMost(node): N

- #### Parameters

  - ##### node: N

  #### Returns N

  Inherited from IBinaryTree.getLeftMost

  - Defined in src/interfaces/abstract-binary-tree.ts:91
- getLeftMost(node?): null | N

- #### Parameters

  - ##### `Optional` node: null | N

  #### Returns null | N

  Inherited from IBinaryTree.getLeftMost

  - Defined in src/interfaces/abstract-binary-tree.ts:93

### getMinHeight

- getMinHeight(beginRoot?): number

- #### Parameters

  - ##### `Optional` beginRoot: null | N

  #### Returns number

  Inherited from IBinaryTree.getMinHeight

  - Defined in src/interfaces/abstract-binary-tree.ts:77

### getNodes

- getNodes(nodeProperty, propertyName?, onlyOne?): N[]

- #### Parameters

  - ##### nodeProperty: number | N

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  - ##### `Optional` onlyOne: boolean

  #### Returns N[]

  Overrides IBinaryTree.getNodes

  - Defined in src/interfaces/bst.ts:18

### getPathToRoot

- getPathToRoot(node): N[]

- #### Parameters

  - ##### node: N

  #### Returns N[]

  Inherited from IBinaryTree.getPathToRoot

  - Defined in src/interfaces/abstract-binary-tree.ts:87

### getPredecessor

- getPredecessor(node): N

- #### Parameters

  - ##### node: N

  #### Returns N

  Inherited from IBinaryTree.getPredecessor

  - Defined in src/interfaces/abstract-binary-tree.ts:176

### getRightMost

- getRightMost(): null | N

- #### Returns null | N

  Inherited from IBinaryTree.getRightMost

  - Defined in src/interfaces/abstract-binary-tree.ts:95
- getRightMost(node): N

- #### Parameters

  - ##### node: N

  #### Returns N

  Inherited from IBinaryTree.getRightMost

  - Defined in src/interfaces/abstract-binary-tree.ts:97
- getRightMost(node?): null | N

- #### Parameters

  - ##### `Optional` node: null | N

  #### Returns null | N

  Inherited from IBinaryTree.getRightMost

  - Defined in src/interfaces/abstract-binary-tree.ts:99

### getSubTreeSize

- getSubTreeSize(subTreeRoot): number

- #### Parameters

  - ##### subTreeRoot: undefined | null | N

  #### Returns number

  Inherited from IBinaryTree.getSubTreeSize

  - Defined in src/interfaces/abstract-binary-tree.ts:105

### has

- has(nodeProperty, propertyName?): boolean

- #### Parameters

  - ##### nodeProperty: number | N

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns boolean

  Inherited from IBinaryTree.has

  - Defined in src/interfaces/abstract-binary-tree.ts:83

### isAVLBalanced

- isAVLBalanced(): boolean

- #### Returns boolean

  - Defined in src/interfaces/bst.ts:28

### isBST

- isBST(): boolean

- #### Returns boolean

  Inherited from IBinaryTree.isBST

  - Defined in src/interfaces/abstract-binary-tree.ts:103

### isEmpty

- isEmpty(): boolean

- #### Returns boolean

  Inherited from IBinaryTree.isEmpty

  - Defined in src/interfaces/abstract-binary-tree.ts:63

### isPerfectlyBalanced

- isPerfectlyBalanced(beginRoot?): boolean

- #### Parameters

  - ##### `Optional` beginRoot: null | N

  #### Returns boolean

  Inherited from IBinaryTree.isPerfectlyBalanced

  - Defined in src/interfaces/abstract-binary-tree.ts:79

### isSubtreeBST

- isSubtreeBST(node): boolean

- #### Parameters

  - ##### node: null | N

  #### Returns boolean

  Inherited from IBinaryTree.isSubtreeBST

  - Defined in src/interfaces/abstract-binary-tree.ts:101

### lastKey

- lastKey(): number

- #### Returns number

  - Defined in src/interfaces/bst.ts:14

### lesserSum

- lesserSum(id, propertyName?): number

- #### Parameters

  - ##### id: number

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns number

  - Defined in src/interfaces/bst.ts:22

### levelIterative

- levelIterative(node): number[]

- #### Parameters

  - ##### node: null | N

  #### Returns number[]

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:152
- levelIterative(node, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "id"

  #### Returns number[]

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:154
- levelIterative(node, nodeOrPropertyName?): N["val"][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "val"

  #### Returns N["val"][]

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:156
- levelIterative(node, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "node"

  #### Returns N[]

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:158
- levelIterative(node, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "count"

  #### Returns number[]

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:160
- levelIterative(node, nodeOrPropertyName?): AbstractBinaryTreeNodeProperties <N>

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperties <N>

  Inherited from IBinaryTree.levelIterative

  - Defined in src/interfaces/abstract-binary-tree.ts:162

### listLevels

- listLevels(node): number[][]

- #### Parameters

  - ##### node: null | N

  #### Returns number[][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:164
- listLevels(node, nodeOrPropertyName?): number[][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "id"

  #### Returns number[][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:166
- listLevels(node, nodeOrPropertyName?): N["val"][][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "val"

  #### Returns N["val"][][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:168
- listLevels(node, nodeOrPropertyName?): N[][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "node"

  #### Returns N[][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:170
- listLevels(node, nodeOrPropertyName?): number[][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: "count"

  #### Returns number[][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:172
- listLevels(node, nodeOrPropertyName?): AbstractBinaryTreeNodeProperty <N>[][]

- #### Parameters

  - ##### node: null | N

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperty <N>[][]

  Inherited from IBinaryTree.listLevels

  - Defined in src/interfaces/abstract-binary-tree.ts:174

### morris

- morris(): number[]

- #### Returns number[]

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:178
- morris(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "id"

  #### Returns number[]

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:180
- morris(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "val"

  #### Returns N[]

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:182
- morris(pattern?, nodeOrPropertyName?): N[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "node"

  #### Returns N[]

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:184
- morris(pattern?, nodeOrPropertyName?): number[]

- #### Parameters

  - ##### `Optional` pattern: DFSOrderPattern

  - ##### `Optional` nodeOrPropertyName: "count"

  #### Returns number[]

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:186
- morris(pattern?, nodeOrPropertyName?): AbstractBinaryTreeNodeProperties <N>

- #### Parameters

  - ##### `Optional` pattern: "in" | "pre" | "post"

  - ##### `Optional` nodeOrPropertyName: NodeOrPropertyName

  #### Returns AbstractBinaryTreeNodeProperties <N>

  Inherited from IBinaryTree.morris

  - Defined in src/interfaces/abstract-binary-tree.ts:188

### perfectlyBalance

- perfectlyBalance(): boolean

- #### Returns boolean

  - Defined in src/interfaces/bst.ts:26

### remove

- remove(id, ignoreCount?): BinaryTreeDeletedResult <N>[]

- #### Parameters

  - ##### id: number

  - ##### `Optional` ignoreCount: boolean

  #### Returns BinaryTreeDeletedResult <N>[]

  Overrides IBinaryTree.remove

  - Defined in src/interfaces/bst.ts:16

### subTreeAdd

- subTreeAdd(subTreeRoot, delta, propertyName?): boolean

- #### Parameters

  - ##### subTreeRoot: N

  - ##### delta: number

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns boolean

  Inherited from IBinaryTree.subTreeAdd

  - Defined in src/interfaces/abstract-binary-tree.ts:111

### subTreeSum

- subTreeSum(subTreeRoot, propertyName?): number

- #### Parameters

  - ##### subTreeRoot: N

  - ##### `Optional` propertyName: BinaryTreeNodePropertyName

  #### Returns number

  Inherited from IBinaryTree.subTreeSum

  - Defined in src/interfaces/abstract-binary-tree.ts:109

### swapLocation

- swapLocation(srcNode, destNode): N

- #### Parameters

  - ##### srcNode: N

  - ##### destNode: N

  #### Returns N

  Inherited from IBinaryTree.swapLocation

  - Defined in src/interfaces/abstract-binary-tree.ts:59

Generated using TypeDoc