Page 2 of 2

Posted: Mon Jun 11, 2007 8:35 pm
by Jan
Try the case.

Input:

Code: Select all

5
0 20 0 20
2 18 2 18
4 16 4 16
6 14 6 14
8 12 8 12
15 15
17 17
13 13
19 19
10 10
0
Output:

Code: Select all

Heap 1
(A,4) (B,2) (C,1) (D,3) (E,5)
Hope it helps.

Posted: Sun Jun 17, 2007 5:20 pm
by ral
My program works in this test case.

Posted: Sun Jun 17, 2007 9:22 pm
by Jan
Change the order of the second part. For example..

Input:

Code: Select all

5
0 20 0 20
2 18 2 18
4 16 4 16
6 14 6 14
8 12 8 12
15 15
10 10
17 17
19 19
13 13
5
0 20 0 20
2 18 2 18
4 16 4 16
6 14 6 14
8 12 8 12
10 10
15 15
13 13
17 17
19 19
0
Output:

Code: Select all

Heap 1
(A,4) (B,3) (C,1) (D,5) (E,2)

Heap 2
(A,5) (B,4) (C,2) (D,3) (E,1)
Hope these help. I thought that you would change the order and verify.

Re: 663 - Sorting Slides

Posted: Sun Oct 26, 2008 5:22 am
by DJWS
Edit: I found the error in my algorithm. AC now.

Here is one of mine implementations:

Code: Select all

Cut.