===Псевдокод алгоритма===
<code>   '''function''' findCycles('''int''' p[]):       '''vector<bool>''' used(n)             ''<font color="green">// массив, где отмечены посещенные позиции</font>''
  
       '''for''' i = 1 '''to''' n             '''if''' '''not''' used[i]                   j = i                   '''vector<int>''' cycle                   '''while''' '''not''' used[j]                         cycle.push_back(p[j])                         used[j] = ''true''                         j = p[j]                   '''print''' cycle              ''<font color="green">// распечатаем выведем на экран очередной цикл перестановки</font>''</code>
==См. также==