Structure

latest

Algebraic and data structures
dn-m/Structure

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

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

Last updated: Tue Apr 02 2024 21:35:24 GMT-0900 (Hawaii-Aleutian Daylight Time)