Reikriam

recurse2

Jul 5th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. def bar1(tocarry, toindex, fromindex, j, stop, n, replacement):
  2. while fromindex[j] < stop:
  3. if replacement:
  4. for k in range(j + 1, n):
  5. fromindex[k] = fromindex[j]
  6. else:
  7. for k in range(j + 1, n):
  8. fromindex[k] = fromindex[j] + k - j
  9. if (j + 1) == n:
  10. for k in range(n):
  11. tocarry[k][toindex[k]] = fromindex[k]
  12. toindex[k] += 1
  13. else:
  14. bar1(tocarry, toindex, fromindex, j + 1, stop, n, replacement)
  15. fromindex[j] += 1
Add Comment
Please, Sign In to add comment