Struct dogs::data_structures::sparse_set::SparseSet[][src]

pub struct SparseSet { /* fields omitted */ }
Expand description

implements a sparse set data-structure. this structure is efficient to remove all but one values, but is costly in memory. if n is the number elements and m the number of subsets in the set this data-structure has the following complexities:

  • memory: O(n+m)
  • insertion: O(1)
  • remove: O(1)
  • contains: O(1)
  • remove all but one: O(1)

Implementations

creates a new sparse set from its maximum size (nb_max)

returns true iff the set is empty

returns the number of elements in the set

returns the nth element of the set

true iff e ∈ Set

inserts e into the set

removes e from the set

removes everything except e from the set

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.