title: Heap's algorithm time complexity
body: <p>can anyone tell me what exactly is the time complexity of this Heap's algorithm shown in wikipedia, <a href="https://en.wikipedia.org/wiki/Heap%27s_algorithm" rel="noreferrer">https://en.wikipedia.org/wiki/Heap%27s_algorithm</a> ?</p>
  
  <p>I searched several websites and the answers are all vague, some of them say the time complexity is O(N!) some of them say it's O(NlogN). Which one is the correct answer? And why?</p>
  
  <p>Thank you.</p>