0
What is the time complexity of heaps law of permutations?
Don't explain heap sort.
2 Respostas
0
Jan Markus i couldn't get the last few lines
0
def generate(l,a):
if l ==1 :
print(*a)
else:
for i in range(l):
generate(l-1,a)
if i % 2==0:
a[i],a[l-1] = a[l-1],a[i]
else:
a[0],a[l-1] = a[l-1],a[0]
generate(3,[1,2,3])
Can you brak this down pls