On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote:
Hi, this question is not specifically D related but I'll just
ask anyway. Consider the following snippet:
void mergeSort(int[] arr, int l, int r)
{
if (l < r) // 1
{
int m = l+(r-l)/2;// 2
On 06/25/2018 07:45 PM, zbr wrote:
void mergeSort(int[] arr, int l, int r)
{
if (l < r) // 1
{
int m = l+(r-l)/2; // 2
mergeSort(arr, l, m); // 3
mergeSort(arr, m+1, r); // 4
merge(arr, l, m, r); // 5
On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote:
Hi, this question is not specifically D related but I'll just
ask anyway. Consider the following snippet:
[...]
Your mistake is in your visualization :-)
But... more like:
0 < 4 ? true : mergeSort(0,2) && mergeSort(3, 4)
And so on.
I.e,
Hi, this question is not specifically D related but I'll just ask
anyway. Consider the following snippet:
void mergeSort(int[] arr, int l, int r)
{
if (l < r) // 1
{
int m = l+(r-l)/2;// 2
mergeSort(arr, l, m); // 3