I have two problems on permutations which I can´t solve now becuase my knowledge about permutations and the necessary tricks is very poor.(adsbygoogle = window.adsbygoogle || []).push({});

1st:

Find an algorithm that for given natural N (N<=1000), K and given permutation of N elements will find the Kth composition of this permutation in time less or equal to O(N log K).

2nd:

Find an algorithm that fot given natural N (N<=1000) and given permutation of N elements will determine the number of all cycles that the permutation is composed from in time less or equal to O(n).

Can anybody give me some hint related with any of this two problems, I´m mainly confused as to the satisfaction the maximal possible effecienty.

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 2 problems on permutations

Loading...

Similar Threads for problems permutations | Date |
---|---|

Fortran Fortran for Computational Fluid Dynamics Problems | Jan 11, 2018 |

Hacking: Legal and Ethical Problems | Dec 6, 2017 |

Silver Prospector Problem (General Case) | Nov 11, 2017 |

Python Shuffling in classification problems | Nov 11, 2017 |

Problem in Permutations C++ | Sep 10, 2008 |

**Physics Forums - The Fusion of Science and Community**