You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SwiftDataStructures is a framework of commonly-used data structures for Swift.
Included:
Deque
A Deque is a data structure comprised
of two queues. This implementation has a front queue, which is reversed, and a back queue,
which is not. Operations at either end of the Deque have the same complexity as operations
on the end of either queue.
Three structs conform to the DequeType protocol: Deque, DequeSlice, and
ContiguousDeque. These correspond to the standard library array types.
Discussion of this specific implementation is available
here.
List
A singly-linked, lazy list. Head-tail decomposition can be accomplished with a
switch statement:
Operations on the beginning of the list are O(1), whereas other operations are O(n).
Discussion of this specific implementation is available
here.
Trie
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.
Discussion of this specific implementation is available
here.