2
$\begingroup$

I was able to come up with few examples where number of comparisons in insertion sort were fewer than that of bubble sort and some examples where they were same.

However I am not able to prove that number of comparisons in insertion sort will always be less than or equal to that of bubble sort.

For insertion sort, I am considering the standard variant which is available here https://en.m.wikipedia.org/wiki/Insertion_sort . For bubble sort, I am considering the variant available here https://en.m.wikipedia.org/wiki/Bubble_sort

Can someone please help me?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.