BinaryIndexedTree
BinaryIndexedTree implementation
Static Method Summary
Static Public Methods | ||
public static |
build(seed: Array<number>): BinaryIndexedTree |
Constructor Summary
Public Constructor | ||
public |
constructor(size: number) |
Method Summary
Public Methods | ||
public |
|
|
public |
linear search. |
|
public |
linear search. |
|
public |
|
|
public |
linear search. |
|
public |
lastIndexOf(target: number, equal: Function): number linear search. |
|
public |
lowerBound(target: number, comp: Function): number find lower bound. |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
upperBound(target: number, comp: Function): number find upper bound. |
Static Public Methods
public static build(seed: Array<number>): BinaryIndexedTree source
Public Constructors
Public Methods
public find(check: Function): number source
linear search.
Params:
Name | Type | Attribute | Description |
check | Function | function |
public findIndex(check: Function): number source
linear search.
Params:
Name | Type | Attribute | Description |
check | Function | function |
public get(idx: number): number source
Params:
Name | Type | Attribute | Description |
idx | number | should be less than size of BIT |
public lowerBound(target: number, comp: Function): number source
find lower bound. SEQUENCE SHOULD BE INCREASING IN ORDER (GIVEN BY COMPERATOR). IF ANY ITEM HAS MINUS VALUE, THIS METHOD WILL NOT WORK.
public original(idx: number): number source
Params:
Name | Type | Attribute | Description |
idx | number | should be less than size of BIT |
public prefix(idx: number): number source
Params:
Name | Type | Attribute | Description |
idx | number | should be less than size of BIT |