FileDocCategorySizeDatePackage
Algorithms8.javaAPI DocExample1048Sat Sep 12 03:01:00 BST 1998None

Algorithms8

public class Algorithms8 extends Object
Sorting provides algorithms for sorting a sequence.
see
com.objectspace.jgl.algorithms.Sorting
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    Array array = new Array();
    array.add( new Integer( 3 ) );
    array.add( new Integer( -2 ) );
    array.add( new Integer( 4 ) );
    array.add( new Integer( -5 ) );
    System.out.println( "unsorted array = " + array );
    Sorting.sort( array );
    System.out.println( "sorted array = " + array );

    Deque deque = new Deque();
    deque.add( "triangle" );
    deque.add( "square" );
    deque.add( "pentagon" );
    deque.add( "hexagon" );
    System.out.println( "unsorted deque = " + deque );
    Sorting.sort( deque, new LessString() );
    System.out.println( "sorted deque = " + deque );