Giter Club home page Giter Club logo

sbbasics's Introduction

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

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

License Language Platform 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; you'll also need the SBCommons package as well

sbbasics's People

Contributors

ebgtoo avatar

Watchers

 avatar

sbbasics's Issues

Heap with Cached Comparability

Implement Heap such that an item's comparability property is cached. If the comparability changes, the Heap property does not change. A User would be required to reheap (or remove/insert) the item in order to have a new comparability property.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.