Last active
April 8, 2017 19:45
-
-
Save sherman/70cbcc1e978caea2c3c0be79675de44d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M - median | |
A[] - less median | |
B[] - more median | |
Строим пару {a, b} из первых элементов | |
Затем берем вторые. И если а2 больше a1 меняем, аналогично с b. Если нет, проверяем следующую пару и тд | |
Пример | |
B = 4 5 3 3 | |
A = 2 2 2 1 | |
2,4 | |
2,5 меняем 2,5 2,4 | |
2,3 оставляем 2,5 2,4 2,3 | |
1,3 меняем 1,5 2,4 2,3 2,3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment