From 42dbac71dbc08be6fca0a3fafb13b9424a4f36d6 Mon Sep 17 00:00:00 2001 From: cyriax Date: Mon, 1 Feb 2021 10:35:49 +0100 Subject: [PATCH] close #74 - sort1D: merge_sort_inplace h2 > matx --- src/modules/gfx_sort1D_algos.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/gfx_sort1D_algos.c b/src/modules/gfx_sort1D_algos.c index 12704c04..0e2200ce 100644 --- a/src/modules/gfx_sort1D_algos.c +++ b/src/modules/gfx_sort1D_algos.c @@ -468,14 +468,19 @@ static int quick_sortLR(){ static int merge_sort_inplace(){ CONTINUE(1); for (step=1;step n) end = n; + for (j=start;j=r) break; + if (r>=end) break; h1=l;h2=r; YIELD(1); if (data[l] < data[r]){ - l++; continue; + l++; + continue; } last=data[r]; for (ll=r-1;ll>=l;ll--) data[ll+1]=data[ll];