Блог пользователя selfcompiler

Автор selfcompiler, 12 лет назад, По-английски

ou are given an array B of n integers. Then the array A is created using array B as following : for each i (1 <= i <= n), we set Ai = Bi + d with the probability Pi, otherwise Ai = Bi. find the expect number of swaps that bubble sorting will make when the array A is sorted .......

for example if input is this n=4 d=7 elements of array B = 5 6 1 7 probability of array of elements B = 25 74 47 99\ answer=1.6049

Полный текст и комментарии »

  • Проголосовать: нравится
  • -45
  • Проголосовать: не нравится