Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Odd-even Merge Sort when n=1 #69

Closed
jaeseok-huh opened this issue Jun 8, 2019 · 1 comment
Closed

Odd-even Merge Sort when n=1 #69

jaeseok-huh opened this issue Jun 8, 2019 · 1 comment

Comments

@jaeseok-huh
Copy link
Contributor

jaeseok-huh commented Jun 8, 2019

(For the future readers, I'm looking at commit 6285bfa)
When n=1, in the Algorithm 3.2 Odd-Even Merge Sort, it is not clear how the function call works.
Line 4, 5 should be ignored because the lengths of the arguments are less than 2.
Then the resulting sequence (line 8) is not correct. A counterexample is shown below.

A=(2,5), B=(1,6)   (n=1)
Line 8 yields (2, 1, 5, 6)

Could someone help me out?

@cyron1259
Copy link

Issue #62 solves your problem, although this ruins the even length assumption.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants