Skip to content

dn-m/Structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structure

Swift Build Status

The Structure package defines algebraic and data structures in Swift 5.x, along with algorithms to be performed over them.

Modules

The contents of this Swift package are split amongst four modules.

Deconstruct Sequence types for functional-style recursive algorithms.

Protocols and structures for defining types like Semigroup, Monoid, and Group.

  • Linear data structures (Stack, Queue, LinkedList, Matrix, SortedArray, and more)
  • Hash-based structures (OrderedDictionary, SortedDictionary)
  • Tree structures (Tree, BinarySearchTree, AVLTree)
  • Graph structures (Graph, WeightedGraph, DirectedGraph, WeightedDirectedGraph)

Algorithms for restructuring elements in Sequence and Collection types, like subsets and combinations.

Getting Started

Requirements

Installation

To include the Structure package in your own project, add it to the dependencies section of your Package.swift file:

let package = Package(
    name: ...,
    products: [ ... ],
    dependencies: [
        ...,
        .package(url: "https://github.com/dn-m/Structure", from: "0.19.0")
    ],
    targets: [ ... ]
)

To use a given module in your own project, import the desired module:

import Algebra
import Destructure
import DataStructures
import Algorithms

Development

To contribute to the Structure package, clone the git repository:

git clone https://github.com/dn-m/Structure && cd Structure

Build the package:

swift build

Run the tests:

swift test

If you use the Xcode IDE, use Swift Package Manager to generate an .xcodeproj file:

swift package generate-xcodeproj