Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized,create):GrowableDisjointSet<T>
Defined in: packages/disjoint-set/src/serialization/json.ts:234
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”SerializedGrowableDisjointSet<T>
The partition to restore, either statically typed or
decoded as unknown.
create
Section titled “create”Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized):GrowableDisjointSet<T>
Defined in: packages/disjoint-set/src/serialization/json.ts:238
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”SerializedGrowableDisjointSet<T>
The partition to restore, either statically typed or
decoded as unknown.
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson(
serialized,create):GrowableDisjointSet<number>
Defined in: packages/disjoint-set/src/serialization/json.ts:239
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Parameters
Section titled “Parameters”serialized
Section titled “serialized”The partition to restore, either statically typed or
decoded as unknown.
create
Section titled “create”Returns
Section titled “Returns”GrowableDisjointSet<number>
Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson(
serialized):IndexedDisjointSet
Defined in: packages/disjoint-set/src/serialization/json.ts:243
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Parameters
Section titled “Parameters”serialized
Section titled “serialized”The partition to restore, either statically typed or
decoded as unknown.
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized,create):GrowableDisjointSet<number|T>
Defined in: packages/disjoint-set/src/serialization/json.ts:244
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”The partition to restore, either statically typed or
decoded as unknown.
create
Section titled “create”Returns
Section titled “Returns”GrowableDisjointSet<number | T>
Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized):DeserializedDisjointSet<T>
Defined in: packages/disjoint-set/src/serialization/json.ts:248
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”The partition to restore, either statically typed or
decoded as unknown.
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized,options):GrowableDisjointSet<T>
Defined in: packages/disjoint-set/src/serialization/json.ts:249
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”unknown
The partition to restore, either statically typed or
decoded as unknown.
options
Section titled “options”DeserializeDisjointSetJsonOptions<T> & object
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson<
T>(serialized,options):DeserializedDisjointSet<T>
Defined in: packages/disjoint-set/src/serialization/json.ts:253
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”serialized
Section titled “serialized”unknown
The partition to restore, either statically typed or
decoded as unknown.
options
Section titled “options”DeserializeDisjointSetJsonOptions<T>
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.
Call Signature
Section titled “Call Signature”deserializeDisjointSetJson(
serialized):DeserializedDisjointSet<unknown>
Defined in: packages/disjoint-set/src/serialization/json.ts:257
Rebuild a disjoint set from a SerializedDisjointSet, restoring its recorded implementation unless a factory override is supplied. O(n * alpha(n)) time.
Elements are added in serialized order, then every element is merged with the
first element carrying its label. A round trip through
serializeDisjointSetJson and deserializeDisjointSetJson preserves size,
setCount, element order, and connectivity.
It does not preserve which member is the representative.
Untyped input produces a DeserializedDisjointSet of unknown because
the runtime kind may select either a generic layout or the numeric indexed
layout. Pass an element type guard to validate generic decoded values.
Parameters
Section titled “Parameters”serialized
Section titled “serialized”unknown
The partition to restore, either statically typed or
decoded as unknown.
Returns
Section titled “Returns”DeserializedDisjointSet<unknown>
Throws
Section titled “Throws”When the serialized shape or an element is
invalid, or the two arrays have different lengths. Distinguish causes with
error.code, one of DisjointSetErrorCode.
Throws
Section titled “Throws”When an element occurs twice.