Git Product home page Git Product logo

libite's Introduction

libite

libite is a set of header-based intrusive containers in C++, originally part of liboco and created as an exercise for the author. It is not meant as a replacement for other, similar template libraries. Requires libace.

The following container templates are currently implemented

  • heap --- Pairing heap implementing inhume & exhume.
  • queue --- FIFO container implementing enqueue & dequeue, plus merge sort and in-place reverse. Replaces order.
  • list --- Doubly-linked list implementing enlist & delist.
  • set --- Disjoint set implementing join, archetype, & dissolve.
  • stack --- LIFO container implementing push & pop.
  • table --- Chained hash table implementing set, get, & bus; user is responsible for providing hash buckets and performing rehashing.
  • tree --- Red-black tree implementing graft & prune, as well as find and efficient iteration via next & prev.

as well as the following utility templates

  • compare --- Generic less-than, equal, greater-than template.
  • link --- Shared pointer wrapper, which asserts that links are removed from a container prior to object destruction.
  • hash --- Generic hash template, implemented as 64-bit FNV-1a.

and the following test programs

  • argsort --- Take program arguments, sort via heap, & write to std::cout.
  • bagofwords --- Take program arguments & write frequency to std::cout.
  • dijkstra --- Read (from, to, cost) tuples on std::cin, perform Dijkstra's algorithm on the graph starting at the lexicographically first node, & write routes plus costs to std::cout.
  • heapsort --- Read ints on std::cin, sort via heap, & write to std::cout.
  • kruskal --- Read (from, to, cost) tuples on std::cin, perform Kruskal's algorithm on the graph, & write edges composing a minimum spanning tree to std::cout.
  • mergesort --- Read ints on std::cin, sort via queue::sorter, & write to std::cout.
  • tarjan --- Read (from, to) tuples on std::cin, perform Tarjan's algorithm on the graph, & write sets of strongly connected components to std::cout, one set per line.
  • treesort --- Read ints on std::cin, sort via tree, & write to std::cout.

With assertions enabled, heap and tree are validated as pre- and post-conditions, which will wreck the algorithmic complexity; to disable, define NDEBUG.

A small test suite is available and can be run via

  • make test

While libite is just a toy, the intention is to continue to add features and new containers.

libite's People

Contributors

pallas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.