What is the complexity of this sorting algorithm?

Правка en2, от 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!

Теги stayathome

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский 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 Английский BlueDiamond 2020-03-26 23:13:03 527 Initial revision (saved to drafts)