From aef5b884067e4e5128f3b2d0950f82e3ebc74236 Mon Sep 17 00:00:00 2001 From: James Bean Date: Wed, 28 Aug 2019 22:32:17 +0200 Subject: [PATCH] Organize DataStructures into categories (#218) --- Sources/DataStructures/{ => ADTs}/Either.swift | 0 Sources/DataStructures/{ => ADTs}/IntervalRelation.swift | 0 Sources/DataStructures/{ => ADTs}/InvertibleEnum.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/Cross.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/OrderedPair.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/Pair.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/SwappablePair.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/SymmetricPair.swift | 0 Sources/DataStructures/{Pair => ADTs/Pairs}/UnorderedPair.swift | 0 Sources/DataStructures/{ => Extras}/CollectionExtensions.swift | 1 + Sources/DataStructures/{ => Extras}/Homogeneity.swift | 1 + Sources/DataStructures/{ => Extras}/RangeProtocol+Algebra.swift | 1 + Sources/DataStructures/{ => Extras}/RangeProtocol.swift | 2 ++ Sources/DataStructures/{ => Extras}/SequenceExtensions.swift | 1 + Sources/DataStructures/{ => Extras}/SetExtensions.swift | 1 + Sources/DataStructures/{ => Graphs/Graph}/AdjacencyList.swift | 0 Sources/DataStructures/{ => Graphs}/Graph/DirectedGraph.swift | 0 Sources/DataStructures/{ => Graphs}/Graph/Graph.swift | 0 .../{ => Graphs}/Graph/Protocols/DirectedGraphProtocol.swift | 0 .../{ => Graphs}/Graph/Protocols/GraphProtocol.swift | 0 .../{ => Graphs}/Graph/Protocols/UndirectedGraphProtocol.swift | 0 .../{ => Graphs}/Graph/Protocols/UnweightedGraphProtocol.swift | 0 .../{ => Graphs}/Graph/Protocols/WeightedGraphProtocol.swift | 0 .../{ => Graphs/Graph}/ReferenceGraph.AdjacencyList.swift | 0 .../DataStructures/{ => Graphs/Graph}/ReferenceGraph.Edge.swift | 0 .../{ => Graphs/Graph}/ReferenceGraph.EdgeList.swift | 0 .../DataStructures/{ => Graphs/Graph}/ReferenceGraph.Node.swift | 0 Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.swift | 0 .../{ => Graphs}/Graph/WeightedDirectedGraph.swift | 0 Sources/DataStructures/{ => Graphs}/Graph/WeightedGraph.swift | 0 Sources/DataStructures/{ => Hash}/Bimap.swift | 0 .../ContiguousSegmentCollection.swift | 0 .../{ => Hash}/ContiguousSegmentCollection/Fragmentable.swift | 0 .../{ => Hash}/ContiguousSegmentCollection/Intervallic.swift | 0 .../ContiguousSegmentCollection/IntervallicFragmentable.swift | 0 .../{ => Hash}/ContiguousSegmentCollection/Measured.swift | 0 .../{ => Hash}/ContiguousSegmentCollection/Totalizable.swift | 0 Sources/DataStructures/{ => Hash}/DictionaryProtocol.swift | 0 Sources/DataStructures/{ => Hash}/OrderedDictionary.swift | 0 Sources/DataStructures/{ => Hash}/SortedDictionary.swift | 0 Sources/DataStructures/{ => Linear}/CircularArray.swift | 0 Sources/DataStructures/{ => Linear}/LinkedList.swift | 0 Sources/DataStructures/{ => Linear}/Matrix.swift | 0 Sources/DataStructures/{ => Linear}/Queue.swift | 0 Sources/DataStructures/{ => Linear}/SortedArray.swift | 0 Sources/DataStructures/{ => Linear}/Stack.swift | 0 Sources/DataStructures/{ => Linear}/Zip3Sequence.swift | 0 Sources/DataStructures/{ => Linear}/ZipToLongest.swift | 0 Sources/DataStructures/{ => Trees}/AVLTree.swift | 0 Sources/DataStructures/{ => Trees}/BinaryHeap.swift | 0 Sources/DataStructures/{ => Trees}/BinarySearchTree.swift | 0 Sources/DataStructures/{ => Trees}/ReferenceTree.swift | 0 Sources/DataStructures/{ => Trees}/ReferenceTreeProtocol.swift | 0 Sources/DataStructures/{ => Trees}/SingleTypedTree.swift | 0 Sources/DataStructures/{ => Trees}/Tree.Zipper.swift | 0 Sources/DataStructures/{ => Trees}/Tree.swift | 0 Sources/DataStructures/{ => Wrapping}/Identifier.swift | 0 Sources/DataStructures/{ => Wrapping}/Metatype.swift | 0 Sources/DataStructures/{ => Wrapping}/NewType.swift | 0 59 files changed, 7 insertions(+) rename Sources/DataStructures/{ => ADTs}/Either.swift (100%) rename Sources/DataStructures/{ => ADTs}/IntervalRelation.swift (100%) rename Sources/DataStructures/{ => ADTs}/InvertibleEnum.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/Cross.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/OrderedPair.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/Pair.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/SwappablePair.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/SymmetricPair.swift (100%) rename Sources/DataStructures/{Pair => ADTs/Pairs}/UnorderedPair.swift (100%) rename Sources/DataStructures/{ => Extras}/CollectionExtensions.swift (98%) rename Sources/DataStructures/{ => Extras}/Homogeneity.swift (93%) rename Sources/DataStructures/{ => Extras}/RangeProtocol+Algebra.swift (93%) rename Sources/DataStructures/{ => Extras}/RangeProtocol.swift (91%) rename Sources/DataStructures/{ => Extras}/SequenceExtensions.swift (96%) rename Sources/DataStructures/{ => Extras}/SetExtensions.swift (91%) rename Sources/DataStructures/{ => Graphs/Graph}/AdjacencyList.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/DirectedGraph.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Graph.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Protocols/DirectedGraphProtocol.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Protocols/GraphProtocol.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Protocols/UndirectedGraphProtocol.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Protocols/UnweightedGraphProtocol.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/Protocols/WeightedGraphProtocol.swift (100%) rename Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.AdjacencyList.swift (100%) rename Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.Edge.swift (100%) rename Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.EdgeList.swift (100%) rename Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.Node.swift (100%) rename Sources/DataStructures/{ => Graphs/Graph}/ReferenceGraph.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/WeightedDirectedGraph.swift (100%) rename Sources/DataStructures/{ => Graphs}/Graph/WeightedGraph.swift (100%) rename Sources/DataStructures/{ => Hash}/Bimap.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/ContiguousSegmentCollection.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/Fragmentable.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/Intervallic.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/IntervallicFragmentable.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/Measured.swift (100%) rename Sources/DataStructures/{ => Hash}/ContiguousSegmentCollection/Totalizable.swift (100%) rename Sources/DataStructures/{ => Hash}/DictionaryProtocol.swift (100%) rename Sources/DataStructures/{ => Hash}/OrderedDictionary.swift (100%) rename Sources/DataStructures/{ => Hash}/SortedDictionary.swift (100%) rename Sources/DataStructures/{ => Linear}/CircularArray.swift (100%) rename Sources/DataStructures/{ => Linear}/LinkedList.swift (100%) rename Sources/DataStructures/{ => Linear}/Matrix.swift (100%) rename Sources/DataStructures/{ => Linear}/Queue.swift (100%) rename Sources/DataStructures/{ => Linear}/SortedArray.swift (100%) rename Sources/DataStructures/{ => Linear}/Stack.swift (100%) rename Sources/DataStructures/{ => Linear}/Zip3Sequence.swift (100%) rename Sources/DataStructures/{ => Linear}/ZipToLongest.swift (100%) rename Sources/DataStructures/{ => Trees}/AVLTree.swift (100%) rename Sources/DataStructures/{ => Trees}/BinaryHeap.swift (100%) rename Sources/DataStructures/{ => Trees}/BinarySearchTree.swift (100%) rename Sources/DataStructures/{ => Trees}/ReferenceTree.swift (100%) rename Sources/DataStructures/{ => Trees}/ReferenceTreeProtocol.swift (100%) rename Sources/DataStructures/{ => Trees}/SingleTypedTree.swift (100%) rename Sources/DataStructures/{ => Trees}/Tree.Zipper.swift (100%) rename Sources/DataStructures/{ => Trees}/Tree.swift (100%) rename Sources/DataStructures/{ => Wrapping}/Identifier.swift (100%) rename Sources/DataStructures/{ => Wrapping}/Metatype.swift (100%) rename Sources/DataStructures/{ => Wrapping}/NewType.swift (100%) diff --git a/Sources/DataStructures/Either.swift b/Sources/DataStructures/ADTs/Either.swift similarity index 100% rename from Sources/DataStructures/Either.swift rename to Sources/DataStructures/ADTs/Either.swift diff --git a/Sources/DataStructures/IntervalRelation.swift b/Sources/DataStructures/ADTs/IntervalRelation.swift similarity index 100% rename from Sources/DataStructures/IntervalRelation.swift rename to Sources/DataStructures/ADTs/IntervalRelation.swift diff --git a/Sources/DataStructures/InvertibleEnum.swift b/Sources/DataStructures/ADTs/InvertibleEnum.swift similarity index 100% rename from Sources/DataStructures/InvertibleEnum.swift rename to Sources/DataStructures/ADTs/InvertibleEnum.swift diff --git a/Sources/DataStructures/Pair/Cross.swift b/Sources/DataStructures/ADTs/Pairs/Cross.swift similarity index 100% rename from Sources/DataStructures/Pair/Cross.swift rename to Sources/DataStructures/ADTs/Pairs/Cross.swift diff --git a/Sources/DataStructures/Pair/OrderedPair.swift b/Sources/DataStructures/ADTs/Pairs/OrderedPair.swift similarity index 100% rename from Sources/DataStructures/Pair/OrderedPair.swift rename to Sources/DataStructures/ADTs/Pairs/OrderedPair.swift diff --git a/Sources/DataStructures/Pair/Pair.swift b/Sources/DataStructures/ADTs/Pairs/Pair.swift similarity index 100% rename from Sources/DataStructures/Pair/Pair.swift rename to Sources/DataStructures/ADTs/Pairs/Pair.swift diff --git a/Sources/DataStructures/Pair/SwappablePair.swift b/Sources/DataStructures/ADTs/Pairs/SwappablePair.swift similarity index 100% rename from Sources/DataStructures/Pair/SwappablePair.swift rename to Sources/DataStructures/ADTs/Pairs/SwappablePair.swift diff --git a/Sources/DataStructures/Pair/SymmetricPair.swift b/Sources/DataStructures/ADTs/Pairs/SymmetricPair.swift similarity index 100% rename from Sources/DataStructures/Pair/SymmetricPair.swift rename to Sources/DataStructures/ADTs/Pairs/SymmetricPair.swift diff --git a/Sources/DataStructures/Pair/UnorderedPair.swift b/Sources/DataStructures/ADTs/Pairs/UnorderedPair.swift similarity index 100% rename from Sources/DataStructures/Pair/UnorderedPair.swift rename to Sources/DataStructures/ADTs/Pairs/UnorderedPair.swift diff --git a/Sources/DataStructures/CollectionExtensions.swift b/Sources/DataStructures/Extras/CollectionExtensions.swift similarity index 98% rename from Sources/DataStructures/CollectionExtensions.swift rename to Sources/DataStructures/Extras/CollectionExtensions.swift index a5b7c8e..5cdb723 100644 --- a/Sources/DataStructures/CollectionExtensions.swift +++ b/Sources/DataStructures/Extras/CollectionExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Array { /// - Returns: Array with the `element` appended. diff --git a/Sources/DataStructures/Homogeneity.swift b/Sources/DataStructures/Extras/Homogeneity.swift similarity index 93% rename from Sources/DataStructures/Homogeneity.swift rename to Sources/DataStructures/Extras/Homogeneity.swift index 4e1583c..df5709b 100644 --- a/Sources/DataStructures/Homogeneity.swift +++ b/Sources/DataStructures/Extras/Homogeneity.swift @@ -7,6 +7,7 @@ import Destructure +// TODO: Consider moving to the `Algorithms` module. extension Sequence where Element: Equatable { /// - Returns: `true` if there are one or fewer elements in `self`, or if all elements in diff --git a/Sources/DataStructures/RangeProtocol+Algebra.swift b/Sources/DataStructures/Extras/RangeProtocol+Algebra.swift similarity index 93% rename from Sources/DataStructures/RangeProtocol+Algebra.swift rename to Sources/DataStructures/Extras/RangeProtocol+Algebra.swift index f3efb92..e0ffce9 100644 --- a/Sources/DataStructures/RangeProtocol+Algebra.swift +++ b/Sources/DataStructures/Extras/RangeProtocol+Algebra.swift @@ -7,6 +7,7 @@ import Algebra +// TODO: Consider moving to the `Algebra` module. extension ClosedRange: Zero where Bound: Zero { public static var zero: ClosedRange { diff --git a/Sources/DataStructures/RangeProtocol.swift b/Sources/DataStructures/Extras/RangeProtocol.swift similarity index 91% rename from Sources/DataStructures/RangeProtocol.swift rename to Sources/DataStructures/Extras/RangeProtocol.swift index e8ae779..0377465 100644 --- a/Sources/DataStructures/RangeProtocol.swift +++ b/Sources/DataStructures/Extras/RangeProtocol.swift @@ -6,6 +6,8 @@ // /// Unifying interface for `Range` and `ClosedRange` types. +/// +/// TODO: Consider using Standard Library's `RangeExpression` protocol instead. public protocol RangeProtocol { associatedtype Bound: Comparable var lowerBound: Bound { get } diff --git a/Sources/DataStructures/SequenceExtensions.swift b/Sources/DataStructures/Extras/SequenceExtensions.swift similarity index 96% rename from Sources/DataStructures/SequenceExtensions.swift rename to Sources/DataStructures/Extras/SequenceExtensions.swift index 77c224b..3c225d0 100644 --- a/Sources/DataStructures/SequenceExtensions.swift +++ b/Sources/DataStructures/Extras/SequenceExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Sequence { /// All of the values which are the least or greatest given the `areInIncreasingOrder` closure. diff --git a/Sources/DataStructures/SetExtensions.swift b/Sources/DataStructures/Extras/SetExtensions.swift similarity index 91% rename from Sources/DataStructures/SetExtensions.swift rename to Sources/DataStructures/Extras/SetExtensions.swift index 1a424ad..a425793 100644 --- a/Sources/DataStructures/SetExtensions.swift +++ b/Sources/DataStructures/Extras/SetExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Set { public func inserting(_ element: Element) -> Set { diff --git a/Sources/DataStructures/AdjacencyList.swift b/Sources/DataStructures/Graphs/Graph/AdjacencyList.swift similarity index 100% rename from Sources/DataStructures/AdjacencyList.swift rename to Sources/DataStructures/Graphs/Graph/AdjacencyList.swift diff --git a/Sources/DataStructures/Graph/DirectedGraph.swift b/Sources/DataStructures/Graphs/Graph/DirectedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/DirectedGraph.swift rename to Sources/DataStructures/Graphs/Graph/DirectedGraph.swift diff --git a/Sources/DataStructures/Graph/Graph.swift b/Sources/DataStructures/Graphs/Graph/Graph.swift similarity index 100% rename from Sources/DataStructures/Graph/Graph.swift rename to Sources/DataStructures/Graphs/Graph/Graph.swift diff --git a/Sources/DataStructures/Graph/Protocols/DirectedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/DirectedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/DirectedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/DirectedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/GraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/GraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/GraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/GraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/UndirectedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/UndirectedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/UndirectedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/UndirectedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/UnweightedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/UnweightedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/UnweightedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/UnweightedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/WeightedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/WeightedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/WeightedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/WeightedGraphProtocol.swift diff --git a/Sources/DataStructures/ReferenceGraph.AdjacencyList.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.AdjacencyList.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.AdjacencyList.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.AdjacencyList.swift diff --git a/Sources/DataStructures/ReferenceGraph.Edge.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.Edge.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.Edge.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.Edge.swift diff --git a/Sources/DataStructures/ReferenceGraph.EdgeList.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.EdgeList.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.EdgeList.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.EdgeList.swift diff --git a/Sources/DataStructures/ReferenceGraph.Node.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.Node.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.Node.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.Node.swift diff --git a/Sources/DataStructures/ReferenceGraph.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.swift diff --git a/Sources/DataStructures/Graph/WeightedDirectedGraph.swift b/Sources/DataStructures/Graphs/Graph/WeightedDirectedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/WeightedDirectedGraph.swift rename to Sources/DataStructures/Graphs/Graph/WeightedDirectedGraph.swift diff --git a/Sources/DataStructures/Graph/WeightedGraph.swift b/Sources/DataStructures/Graphs/Graph/WeightedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/WeightedGraph.swift rename to Sources/DataStructures/Graphs/Graph/WeightedGraph.swift diff --git a/Sources/DataStructures/Bimap.swift b/Sources/DataStructures/Hash/Bimap.swift similarity index 100% rename from Sources/DataStructures/Bimap.swift rename to Sources/DataStructures/Hash/Bimap.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/ContiguousSegmentCollection.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/ContiguousSegmentCollection.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/ContiguousSegmentCollection.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/ContiguousSegmentCollection.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Fragmentable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Fragmentable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Fragmentable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Fragmentable.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Intervallic.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Intervallic.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Intervallic.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Intervallic.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/IntervallicFragmentable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/IntervallicFragmentable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/IntervallicFragmentable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/IntervallicFragmentable.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Measured.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Measured.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Measured.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Measured.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Totalizable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Totalizable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Totalizable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Totalizable.swift diff --git a/Sources/DataStructures/DictionaryProtocol.swift b/Sources/DataStructures/Hash/DictionaryProtocol.swift similarity index 100% rename from Sources/DataStructures/DictionaryProtocol.swift rename to Sources/DataStructures/Hash/DictionaryProtocol.swift diff --git a/Sources/DataStructures/OrderedDictionary.swift b/Sources/DataStructures/Hash/OrderedDictionary.swift similarity index 100% rename from Sources/DataStructures/OrderedDictionary.swift rename to Sources/DataStructures/Hash/OrderedDictionary.swift diff --git a/Sources/DataStructures/SortedDictionary.swift b/Sources/DataStructures/Hash/SortedDictionary.swift similarity index 100% rename from Sources/DataStructures/SortedDictionary.swift rename to Sources/DataStructures/Hash/SortedDictionary.swift diff --git a/Sources/DataStructures/CircularArray.swift b/Sources/DataStructures/Linear/CircularArray.swift similarity index 100% rename from Sources/DataStructures/CircularArray.swift rename to Sources/DataStructures/Linear/CircularArray.swift diff --git a/Sources/DataStructures/LinkedList.swift b/Sources/DataStructures/Linear/LinkedList.swift similarity index 100% rename from Sources/DataStructures/LinkedList.swift rename to Sources/DataStructures/Linear/LinkedList.swift diff --git a/Sources/DataStructures/Matrix.swift b/Sources/DataStructures/Linear/Matrix.swift similarity index 100% rename from Sources/DataStructures/Matrix.swift rename to Sources/DataStructures/Linear/Matrix.swift diff --git a/Sources/DataStructures/Queue.swift b/Sources/DataStructures/Linear/Queue.swift similarity index 100% rename from Sources/DataStructures/Queue.swift rename to Sources/DataStructures/Linear/Queue.swift diff --git a/Sources/DataStructures/SortedArray.swift b/Sources/DataStructures/Linear/SortedArray.swift similarity index 100% rename from Sources/DataStructures/SortedArray.swift rename to Sources/DataStructures/Linear/SortedArray.swift diff --git a/Sources/DataStructures/Stack.swift b/Sources/DataStructures/Linear/Stack.swift similarity index 100% rename from Sources/DataStructures/Stack.swift rename to Sources/DataStructures/Linear/Stack.swift diff --git a/Sources/DataStructures/Zip3Sequence.swift b/Sources/DataStructures/Linear/Zip3Sequence.swift similarity index 100% rename from Sources/DataStructures/Zip3Sequence.swift rename to Sources/DataStructures/Linear/Zip3Sequence.swift diff --git a/Sources/DataStructures/ZipToLongest.swift b/Sources/DataStructures/Linear/ZipToLongest.swift similarity index 100% rename from Sources/DataStructures/ZipToLongest.swift rename to Sources/DataStructures/Linear/ZipToLongest.swift diff --git a/Sources/DataStructures/AVLTree.swift b/Sources/DataStructures/Trees/AVLTree.swift similarity index 100% rename from Sources/DataStructures/AVLTree.swift rename to Sources/DataStructures/Trees/AVLTree.swift diff --git a/Sources/DataStructures/BinaryHeap.swift b/Sources/DataStructures/Trees/BinaryHeap.swift similarity index 100% rename from Sources/DataStructures/BinaryHeap.swift rename to Sources/DataStructures/Trees/BinaryHeap.swift diff --git a/Sources/DataStructures/BinarySearchTree.swift b/Sources/DataStructures/Trees/BinarySearchTree.swift similarity index 100% rename from Sources/DataStructures/BinarySearchTree.swift rename to Sources/DataStructures/Trees/BinarySearchTree.swift diff --git a/Sources/DataStructures/ReferenceTree.swift b/Sources/DataStructures/Trees/ReferenceTree.swift similarity index 100% rename from Sources/DataStructures/ReferenceTree.swift rename to Sources/DataStructures/Trees/ReferenceTree.swift diff --git a/Sources/DataStructures/ReferenceTreeProtocol.swift b/Sources/DataStructures/Trees/ReferenceTreeProtocol.swift similarity index 100% rename from Sources/DataStructures/ReferenceTreeProtocol.swift rename to Sources/DataStructures/Trees/ReferenceTreeProtocol.swift diff --git a/Sources/DataStructures/SingleTypedTree.swift b/Sources/DataStructures/Trees/SingleTypedTree.swift similarity index 100% rename from Sources/DataStructures/SingleTypedTree.swift rename to Sources/DataStructures/Trees/SingleTypedTree.swift diff --git a/Sources/DataStructures/Tree.Zipper.swift b/Sources/DataStructures/Trees/Tree.Zipper.swift similarity index 100% rename from Sources/DataStructures/Tree.Zipper.swift rename to Sources/DataStructures/Trees/Tree.Zipper.swift diff --git a/Sources/DataStructures/Tree.swift b/Sources/DataStructures/Trees/Tree.swift similarity index 100% rename from Sources/DataStructures/Tree.swift rename to Sources/DataStructures/Trees/Tree.swift diff --git a/Sources/DataStructures/Identifier.swift b/Sources/DataStructures/Wrapping/Identifier.swift similarity index 100% rename from Sources/DataStructures/Identifier.swift rename to Sources/DataStructures/Wrapping/Identifier.swift diff --git a/Sources/DataStructures/Metatype.swift b/Sources/DataStructures/Wrapping/Metatype.swift similarity index 100% rename from Sources/DataStructures/Metatype.swift rename to Sources/DataStructures/Wrapping/Metatype.swift diff --git a/Sources/DataStructures/NewType.swift b/Sources/DataStructures/Wrapping/NewType.swift similarity index 100% rename from Sources/DataStructures/NewType.swift rename to Sources/DataStructures/Wrapping/NewType.swift