diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-01-21 09:50:37 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-01-21 09:50:37 +0100 |
commit | 4176b9b53df47c2351b38695c3d899680403bed2 (patch) | |
tree | 503a1318d449280da53e1fcac8bc3f059e8813ce /src/comparable | |
parent | add interpolation search (diff) | |
download | algorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.gz algorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.bz2 algorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.xz |
m + add hybrid interpolation search
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/comparable')
-rw-r--r-- | src/comparable | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comparable b/src/comparable index 0d3c21e..26feb1f 100644 --- a/src/comparable +++ b/src/comparable @@ -129,6 +129,15 @@ else { echo "($1) < ($2)" } fi +if [[ "${T}" = @(boolean|char|byte|short|int|long|float|double) ]]; then + function equal + { echo "($1) == ($2)" + } +else + function equal + { echo "($1).equals($2)" + } +fi function fun { echo "${Tparam}${1} ${2}(${3}${Targ})" |