简体   繁体   中英

Complexity of itertools.permutations

Can you please tell me what is the complexity of permutations() from the "itertools.permutation" module in python?

I am practicing and learning python, and appreciate any help from you.

It's O(1), because it just returns an object whose next method returns a different permutation each time it is called. The size of the argument to permutations does not affect the time it takes to create that object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM