aboutsummaryrefslogtreecommitdiffstats
path: root/src/comparable
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-01-21 09:50:37 +0100
committerMattias Andrée <maandree@operamail.com>2014-01-21 09:50:37 +0100
commit4176b9b53df47c2351b38695c3d899680403bed2 (patch)
tree503a1318d449280da53e1fcac8bc3f059e8813ce /src/comparable
parentadd interpolation search (diff)
downloadalgorithms-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/comparable9
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})"