Math, asked by Anjnak2067, 11 months ago

Permutations with maximum difference between consecutive numbers

Answers

Answered by devinamita817
0

Answer:

For N = 10, a permutation with distinct integers for consecutive absolute difference can be 1 10 2 9 3 8 4 7 5 6. The consecutive absolute difference gives integers 9, 8, 7 and so on. So, first print K integers of such a sequence then make the rest of the differences equal to 1

Similar questions