Skip to content

Commit

Permalink
Fix #70 and Fix #72
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongho Nam committed Jul 4, 2020
1 parent dce61cd commit 190d260
Show file tree
Hide file tree
Showing 63 changed files with 622 additions and 468 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -6,7 +6,7 @@
"email": "samchon@samchon.org",
"url": "http://samchon.org"
},
"version": "2.4.10",
"version": "2.4.11",
"main": "./index.js",
"typings": "./index.d.ts",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/Container.ts
Expand Up @@ -12,11 +12,11 @@ import { ForOfAdaptor } from "../../internal/iterator/disposable/ForOfAdaptor";
/**
* Basic container.
*
* @type T Stored elements' type
* @type SourceT Derived type extending this {@link Container}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @type PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
* @template T Stored elements' type
* @template SourceT Derived type extending this {@link Container}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
* @template PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/IArrayContainer.ts
Expand Up @@ -10,11 +10,11 @@ import { IRandomAccessIterator } from "../../iterator/IRandomAccessIterator";
/**
* Common interface for array containers.
*
* @type T Stored elements' type
* @type SourceT Derived type extending this {@link IArrayContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @type PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
* @template T Stored elements' type
* @template SourceT Derived type extending this {@link IArrayContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
* @template PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/IContainer.ts
Expand Up @@ -16,11 +16,11 @@ import { IReversableIterator } from "../../iterator/IReversableIterator";
/**
* Common interface for containers.
*
* @type T Stored elements' type
* @type SourceT Derived type extending this {@link IContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @type PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
* @template T Stored elements' type
* @template SourceT Derived type extending this {@link IContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
* @template PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/IDequeContainer.ts
Expand Up @@ -11,11 +11,11 @@ import { ILinearContainer } from "./ILinearContainer";
/**
* Common interface for deque containers.
*
* @type T Stored elements' type
* @type SourceT Derived type extending this {@link IDequeContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @type PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
* @template T Stored elements' type
* @template SourceT Derived type extending this {@link IDequeContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
* @template PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
8 changes: 4 additions & 4 deletions src/base/container/IHashMap.ts
Expand Up @@ -14,10 +14,10 @@ import { MapElementList } from "../../internal/container/associative/MapElementL
/**
* Common interface for hash maps.
*
* @type Key Key type
* @type T Mapped type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link IHashMap}
* @template Key Key type
* @template T Mapped type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link IHashMap}
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
6 changes: 3 additions & 3 deletions src/base/container/IHashSet.ts
Expand Up @@ -11,9 +11,9 @@ import { SetElementList } from "../../internal/container/associative/SetElementL
/**
* Common interface for hash sets.
*
* @type Key Key type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link IHashSet}
* @template Key Key type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link IHashSet}
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/ILinearContainer.ts
Expand Up @@ -14,11 +14,11 @@ import { IForwardIterator } from "../../iterator/IForwardIterator";
/**
* Common interface for linear containers.
*
* @type T Stored elements' type
* @type SourceT Derived type extending this {@link ILinearContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @type PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
* @template T Stored elements' type
* @template SourceT Derived type extending this {@link ILinearContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
* @template PElem Parent type of *T*, used for inserting elements through {@link assign} and {@link insert}.
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
12 changes: 6 additions & 6 deletions src/base/container/ITreeMap.ts
Expand Up @@ -13,12 +13,12 @@ import { Entry } from "../../utility/Entry";
/**
* Common interface for tree maps.
*
* @type Key Key type
* @type T Mapped type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link ITreeMap}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template T Mapped type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link ITreeMap}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
10 changes: 5 additions & 5 deletions src/base/container/ITreeSet.ts
Expand Up @@ -10,11 +10,11 @@ import { ITreeContainer } from "../../internal/container/associative/ITreeContai
/**
* Common interface for tree sets.
*
* @type Key Key type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link ITreeSet}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link ITreeSet}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down
15 changes: 9 additions & 6 deletions src/base/container/MapContainer.ts
Expand Up @@ -20,12 +20,12 @@ import { Temporary } from "../../internal/functional/Temporary";
/**
* Basic map container.
*
* @type Key Key type
* @type T Mapped type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link MapContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template T Mapped type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link MapContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -233,6 +233,9 @@ export abstract class MapContainer<Key, T,
protected abstract _Handle_erase(first: IteratorT, last: IteratorT): void;
}

/**
*
*/
export namespace MapContainer
{
/**
Expand Down
13 changes: 8 additions & 5 deletions src/base/container/MultiMap.ts
Expand Up @@ -12,11 +12,11 @@ import { IPair } from "../../utility/IPair";
/**
* Basic map container allowing duplicated keys.
*
* @type Key Key type
* @type T Mapped type
* @type Source Derived type extending this {@link MultiMap}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template T Mapped type
* @template Source Derived type extending this {@link MultiMap}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -115,6 +115,9 @@ export abstract class MultiMap<Key, T,
}
}

/**
*
*/
export namespace MultiMap
{
/**
Expand Down
13 changes: 8 additions & 5 deletions src/base/container/MultiSet.ts
Expand Up @@ -11,11 +11,11 @@ import { IForwardIterator } from "../../iterator/IForwardIterator";
/**
* Basic set container allowing multiple keys.
*
* @type Key Key type
* @type T Mapped type
* @type Source Derived type extending this {@link MultiSet}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template T Mapped type
* @template Source Derived type extending this {@link MultiSet}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -95,6 +95,9 @@ export abstract class MultiSet<Key,
}
}

/**
*
*/
export namespace MultiSet
{
/**
Expand Down
13 changes: 8 additions & 5 deletions src/base/container/SetContainer.ts
Expand Up @@ -18,11 +18,11 @@ import { Temporary } from "../../internal/functional/Temporary";
/**
* Basic set container.
*
* @type Key Key type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link SetContainer}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template Unique Whether duplicated key is blocked or not
* @template Source Derived type extending this {@link SetContainer}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -229,6 +229,9 @@ export abstract class SetContainer<Key,
protected abstract _Handle_erase(first: IteratorT, last: IteratorT): void;
}

/**
*
*/
export namespace SetContainer
{
/**
Expand Down
13 changes: 8 additions & 5 deletions src/base/container/UniqueMap.ts
Expand Up @@ -16,11 +16,11 @@ import { ErrorGenerator } from "../../internal/exception/ErrorGenerator";
/**
* Basic map container blocking duplicated key.
*
* @type Key Key type
* @type T Mapped type
* @type Source Derived type extending this {@link UniqueMap}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template T Mapped type
* @template Source Derived type extending this {@link UniqueMap}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -257,6 +257,9 @@ export abstract class UniqueMap<Key, T,
}
}

/**
*
*/
export namespace UniqueMap
{
/**
Expand Down
11 changes: 7 additions & 4 deletions src/base/container/UniqueSet.ts
Expand Up @@ -13,10 +13,10 @@ import { ErrorGenerator } from "../../internal/exception/ErrorGenerator";
/**
* Basic set container blocking duplicated key.
*
* @type Key Key type
* @type Source Derived type extending this {@link UniqueSet}
* @type IteratorT Iterator type
* @type ReverseT Reverse iterator type
* @template Key Key type
* @template Source Derived type extending this {@link UniqueSet}
* @template IteratorT Iterator type
* @template ReverseT Reverse iterator type
*
* @author Jeongho Nam - https://github.com/samchon
*/
Expand Down Expand Up @@ -155,6 +155,9 @@ export abstract class UniqueSet<Key,
}
}

/**
*
*/
export namespace UniqueSet
{
/**
Expand Down
43 changes: 19 additions & 24 deletions src/container/Deque.ts
Expand Up @@ -28,31 +28,25 @@ export class Deque<T>
extends ArrayContainer<T, Deque<T>, Deque<T>, Deque.Iterator<T>, Deque.ReverseIterator<T>, T>
implements IArrayContainer<T, Deque<T>, Deque.Iterator<T>, Deque.ReverseIterator<T>>
{
/**
* A matrix containing elements.
*
* This {@link matrix_} is the biggest difference one between {@link Vector} and {@link Deque}.
* Its number of rows follows {@link ROW_SIZE} and number of columns follows {@link get_col_size} which
* returns divide of {@link capacity} and {@link ROW_SIZE}.
*
* By separating segment of elements (segment: row, elements in a segment: col), {@link Deque} takes
* advantage of time complexity on inserting element in middle position. {@link Deque} is {@link ROW_SIZE}
* times faster than {@link Vector} when inserting elements in middle position.
*
* However, separating segment of elements from matrix, {@link Deque} also takes disadvantage of
* time complexity on accessing element. {@link Deque} is {@link ROW_SIZE} times slower than {@link Vector}
* when accessing element.
*/
// A matrix containing elements.
//
// This {@link matrix_} is the biggest difference one between {@link Vector} and {@link Deque}.
// Its number of rows follows {@link ROW_SIZE} and number of columns follows {@link get_col_size} which
// returns divide of {@link capacity} and {@link ROW_SIZE}.
//
// By separating segment of elements (segment: row, elements in a segment: col), {@link Deque} takes
// advantage of time complexity on inserting element in middle position. {@link Deque} is {@link ROW_SIZE}
// times faster than {@link Vector} when inserting elements in middle position.
//
// However, separating segment of elements from matrix, {@link Deque} also takes disadvantage of
// time complexity on accessing element. {@link Deque} is {@link ROW_SIZE} times slower than {@link Vector}
// when accessing element.
private matrix_!: Array<Array<T>>;

/**
* Number of elements stored in the {@link Deque}
*/
// Number of elements stored in the {@link Deque}.
private size_!: number;

/**
* Maximum capacity that current {@link matrix_} can store in.
*/
// Maximum capacity that current {@link matrix_} can store in.
private capacity_!: number;

/* =========================================================
Expand Down Expand Up @@ -136,6 +130,7 @@ export class Deque<T>
* @inheritDoc
*/
public assign(n: number, val: T): void;

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -408,9 +403,6 @@ export class Deque<T>
this.size_--;
}

/**
* @inheritDoc
*/
protected _Pop_back(): void
{
// ERASE LAST ELEMENT
Expand Down Expand Up @@ -625,6 +617,9 @@ export class Deque<T>
}
}

/**
*
*/
export namespace Deque
{
//----
Expand Down

0 comments on commit 190d260

Please sign in to comment.