Changeset 93cdd5c for src/libcfa/stdlib


Ignore:
Timestamp:
Jan 2, 2018, 8:34:33 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
490d9972, f3458a8
Parents:
853451b
Message:

add lower/upper bound bsearch, and update bsearch and its test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib

    r853451b r93cdd5c  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 28 18:43:12 2017
    13 // Update Count     : 277
     12// Last Modified On : Mon Jan  1 17:35:43 2018
     13// Update Count     : 291
    1414//
    1515
     
    186186
    187187forall( otype E | { int ?<?( E, E ); } )
    188 E * bsearch( E key, const E * arr, size_t dim );
    189 
    190 forall( otype E | { int ?<?( E, E ); } )
    191 unsigned int bsearch( E key, const E * arr, size_t dim );
    192 
    193 forall( otype K, otype E | { int ?<?( K, K ); K getKey( E & ); } )
    194 E * bsearch( K key, const E * arr, size_t dim );
    195 
    196 forall( otype K, otype E | { int ?<?( K, K ); K getKey( E & ); } )
    197 unsigned int bsearch( K key, const E * arr, size_t dim );
    198 
    199 forall( otype E | { int ?<?( E, E ); } )
    200 void qsort( E * arr, size_t dim );
     188E * bsearch( E key, const E * vals, size_t dim );
     189
     190forall( otype E | { int ?<?( E, E ); } )
     191size_t bsearch( E key, const E * vals, size_t dim );
     192
     193forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     194E * bsearch( K key, const E * vals, size_t dim );
     195
     196forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     197size_t bsearch( K key, const E * vals, size_t dim );
     198
     199
     200forall( otype E | { int ?<?( E, E ); } )
     201E * bsearchl( E key, const E * vals, size_t dim );
     202
     203forall( otype E | { int ?<?( E, E ); } )
     204size_t bsearchl( E key, const E * vals, size_t dim );
     205
     206forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     207E * bsearchl( K key, const E * vals, size_t dim );
     208
     209forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     210size_t bsearchl( K key, const E * vals, size_t dim );
     211
     212
     213forall( otype E | { int ?<?( E, E ); } )
     214E * bsearchu( E key, const E * vals, size_t dim );
     215
     216forall( otype E | { int ?<?( E, E ); } )
     217size_t bsearchu( E key, const E * vals, size_t dim );
     218
     219forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     220E * bsearchu( K key, const E * vals, size_t dim );
     221
     222forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } )
     223size_t bsearchu( K key, const E * vals, size_t dim );
     224
     225
     226forall( otype E | { int ?<?( E, E ); } )
     227void qsort( E * vals, size_t dim );
    201228
    202229//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.