Structs

The following structs are available globally.

  • A Deque is a data structure comprised of two queues. This implementation has a front queue, which is a reversed array, and a back queue, which is an array. Operations at either end of the Deque have the same complexity as operations on the end of either array.

    See more

    Declaration

    Swift

    public struct Deque<Element> : DequeType
  • A Deque is a data structure comprised of two queues. This implementation has a front queue, which is a reversed ArraySlice, and a back queue, which is an ArraySlice. Operations at either end of the Deque have the same complexity as operations on the end of either ArraySlice.

    Because an ArraySlice presents a view onto the storage of some larger array even after the original array’s lifetime ends, storing the slice may prolong the lifetime of elements that are no longer accessible, which can manifest as apparent memory and object leakage. To prevent this effect, use DequeSlice only for transient computation.

    See more

    Declaration

    Swift

    public struct DequeSlice<Element> : DequeType
  • A Deque is a data structure comprised of two queues. This implementation has a front queue, which is a reversed ContiguousArray, and a back queue, which is a ContiguousArray. Operations at either end of the Deque have the same complexity as operations on the end of either ContiguousArray.

    See more

    Declaration

    Swift

    public struct ContiguousDeque<Element> : DequeType
  • A Trie is a prefix tree data structure. It has set-like operations and properties. Instead of storing hashable elements, however, it stores sequences of hashable elements. As well as set operations, the Trie can be searched by prefix. Insertion, deletion, and searching are all O(n), where n is the length of the sequence being searched for.

    Trie

    Discussion of this specific implementation is available here.

    Full documentation is available here.

    Declaration

    Swift

    public struct Trie<Element : Hashable> : Equatable
  • A Generator for a Tree

    See more

    Declaration

    Swift

    public struct TreeGenerator<Element : Comparable> : GeneratorType
  • A Generator for a Tree, that iterates over it in reverse.

    Declaration

    Swift

    public struct ReverseTreeGenerator<Element : Comparable> : GeneratorType, SequenceType