From f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7 Mon Sep 17 00:00:00 2001 From: zlg Date: Thu, 16 Jun 2016 10:15:33 -0700 Subject: The massive astyle sweep! Code style should be consistent now. All future commits will be run through astyle or they will be amended. --- ch3/3-01_binsearch2.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'ch3/3-01_binsearch2.c') diff --git a/ch3/3-01_binsearch2.c b/ch3/3-01_binsearch2.c index bcd66c3..6502273 100644 --- a/ch3/3-01_binsearch2.c +++ b/ch3/3-01_binsearch2.c @@ -24,7 +24,6 @@ int binsearch(int x, int v[], int n) { int low, mid, high; - low = 0; high = n - 1; while (low <= high) { @@ -42,10 +41,8 @@ int binsearch(int x, int v[], int n) { int binsearch2(int x, int v[], int n) { int low, mid, high; - low = 0; high = n - 1; - while (low < high) { mid = (low + high) / 2; if (x <= v[mid]) { @@ -54,7 +51,6 @@ int binsearch2(int x, int v[], int n) { low = mid + 1; } } - if (x == v[low]) { return low; } else { -- cgit v1.2.3-54-g00ecf