Git Product home page Git Product logo

algo's Introduction

Algo

You don't want to use this code.

I've been reading Steven Skiena's The Algorithm Design Manual lately, to refresh my long-dormant knowledge of fundamental data structures and algorithms. I decided to start implementing a few of the things discussed in the book as a C90 single-header-file library (cribbing heavily from the gospel of stblib). I'm sure every aspiring programmer in the world has already written this code; many of them probably did a better job than I have. If you're looking for quality code, I recommend using theirs instead.

Currently includes:

  • stack (last in, first out)
  • queue (first in, first out)
  • heap / priority queue (log-N insertion, log-N removal of highest-priority element)
  • pool allocator (dynamic memory allocation of fixed-size elements).
  • graph (vertex and edge management, plus flexible breadth- and depth-first searches and topological sorting)

On deck:

  • hash table

Key Features / Design Goals

  • No dynamic memory allocations: all data structures let the user place a strict upper bound on their capacity/usage, and then work entirely within a user-provided buffer of the appropriate size.
  • No (mandatory) external dependencies: only standard C library functions are used, and even these can be overridden with custom implementations through #defines if desired.
  • Robust API: all function inputs are validated. A mechanism to disable this validation is planned, but not yet implemented. All functions should return without side effects if an error occurs (not 100% guaranteed yet, but that's the goal).

algo's People

Contributors

cdwfs avatar

Watchers

 avatar

Forkers

dexception

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.