Order, Sort and Search Data using Bins

BINS is a FORTRAN90 library which sorts data into order, or lumps it into bins, or selects an item of particular rank, or finds the unique elements in a list.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


BINS is available in a C++ version and a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

SUBPAK, a FORTRAN90 library which contains many routines for sorting and searching data.


  1. Jon Bentley, Bruce Weide, Andrew Yao,
    Optimal Expected Time Algorithms for Closest Point Problems,
    ACM Transactions on Mathematical Software,
    Volume 6, Number 4, December 1980, pages 563-580.
  2. Thomas Cormen, Charles Leiserson, Ronald Rivest,
    Introduction to Algorithms,
    MIT Press, 2001,
    ISBN: 0262032937,
    LC: QA76.C662.
  3. Barry Joe,
    GEOMPACK - a software package for the generation of meshes using geometric algorithms,
    Advances in Engineering Software,
    Volume 13, pages 325-331, 1991.
  4. Albert Nijenhuis, Herbert Wilf,
    Combinatorial Algorithms for Computers and Calculators,
    Second Edition,
    Academic Press, 1978,
    ISBN: 0-12-519260-6,
    LC: QA164.N54.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the FORTRAN90 source codes.

Last revised on 26 July 2008.