What is the complexity of this sorting algorithm?

Revision en2, by BlueDiamond, 2020-03-26 23:21:47

Hi!

I was playing around with sorting algorithms and came up with this ideea

Code

I am wondering how many times this code goes through the while loop

Also if you think that variations of this code (like changing the order in which we go through the powers of 2) could work better please let me know.

Thanks!

Tags stayathome

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English BlueDiamond 2020-03-26 23:21:47 277 Tiny change: 'n\n~~~~~\nYour code here...\n~~~~~\n\' -> 'n\n~~~~~\n`vector<int> a`\n~~~~~\n\' (published)
en1 English BlueDiamond 2020-03-26 23:13:03 527 Initial revision (saved to drafts)