Latest 0.1.0
Homepage https://github.com/EBGToo/SBBasics
License MIT
Platforms osx 10.9
Dependencies SBCommons
Authors

Bags, Stacks, Queues, Lists, Heaps, Trees, Graphs

Basics is a collection of largely standalone Swift abstractions for Bag type.

License
Language
Platform
SBBasics
Version

Features

Bags

A Bag defines a minimalistic, narrowly-interfaced container protocol for an arbitrary number
of specifically typed but otherwise arbitary Items. A Bag may hold numerous ‘duplicate’ items.
Generally the ordering of items in a bag is upspecified and the contents of the bag are (meant
to be) invisible. One does not sequence through the bag contents nor does one index into the
bag. There are other Swift data structures that allow for sequencing and indexing.

Stacks

A Stack holds elements according to a LIFO discipline. Elements are pushed onto the top of
a stack and popped off of the top.

Queues

A Queue holds elements according to a FIFO discipline. Elements are enqueued and dequeued.

Lists

A List holds elements according to a LIST discipline whereby the list is wither Empty or
contains an Item as the car (aka head) and another list as the cdr (tail).

Heaps

A Heap stores items according to a ‘Priority Heap’ discipline based on a ordering defined for
Comparable items

Rings

A Ring hold items according to a RING discipline whereby items are put to the tail of the ring
and get from the head of the ring. If the ring is filled to capacity, then put will discard
the oldest item.

Trees

A Tree holds items items according to a rooted TREE discipline.

Graphs

A Graph is a set of Items (as Nodes) connected to one anther (with Edges, possibly weighted).

Usage

Access the framework with

import SBBasics

Installation

Three easy installation options:

Apple Package Manager

In your Package.swift file, add a dependency on SBBasics:

import PackageDescription

let package = Package (
  name: "<your package>",
  dependencies: [
    // ...
    .Package (url: "https://github.com/EBGToo/SBBasics.git",  majorVersion: 0),
    // ...
  ]
)

Cocoa Pods

pod 'SBBasics', '~> 0.1'

XCode

$ git clone https://github.com/EBGToo/SBBasics.git SBBasics

Add the SBBasics Xcode Project to your Xcode Workspace.

Latest podspec

{
    "name": "SBBasics",
    "version": "0.1.0",
    "summary": "Bags, Stacks, Queues, Lists, Heaps, Trees, Graphs",
    "description": "Basics is a collection of largely standalone Swift abstractions for Bag type.",
    "homepage": "https://github.com/EBGToo/SBBasics",
    "license": "MIT",
    "authors": {
        "Ed Gamble": "[email protected]"
    },
    "source": {
        "git": "https://github.com/EBGToo/SBBasics.git",
        "tag": "0.1.0"
    },
    "source_files": "Sources/*.swift",
    "platforms": {
        "osx": "10.9"
    },
    "dependencies": {
        "SBCommons": [
            "~> 0.1"
        ]
    }
}

Pin It on Pinterest

Share This