Could you provide links to related articles that you donβt understand? I'm not sure what aspects they can solve. In addition, there is a theoretical difference, which may be that bubble sorting is more suitable for collections represented as arrays (than those presented as linked lists), while insertion sorting is suitable for linked lists.
The reason may be that the sorting of bubbles always swaps two elements at the same time, which is trivial for both the array and the linked list (more efficiently on arrays), whereas insertion sorting inserts in the place in this list, which is trivial for related but includes moving all subsequent elements in the array to the right.
Having said that, take it with salt. First of all, sorting arrays in practice is almost always faster than sorting linked lists. Just because scanning a list once makes a huge difference. In addition, moving n elements of the array to the right is much faster than performing n (or even n / 2) swaps. This is why other answers correctly claim that insertion sorting is excellent overall and why I really think about the articles you read, because I cannot come up with an easy way to say that it is better in cases A, and it is better in cases B.
b.buchhold
source share