ScratchData LogoScratchData
Back to DarthPickley's profile

Bubble versus Insert Sort

DADarthPickley•Created August 26, 2010
Bubble versus Insert Sort
1
0
120 views
View on Scratch

Description

not based off of Paddle2See's sort in any way, but probably works similarly. The Bubble Sort takes many iterations to achieve a sorted list. however, it is able to work if there is only a replacement capability, as in some languages other than scratch. It compares values two at a time and does it repeatedly until it is sorted. Now, that is probably not how us people would do it. We would probably take one value and then put it in between the values larger and smaller than it, picking up each value only once and inserting it into its right place in the sorted section. This only goes through the list once, and so it is much faster. the only problem is some languages do not support inserting items into lists, and making that capability could add lots of additional time to the sorting time just to insert and delete. But it's closer to real life. green flag to reshuffle, after setting the number of items. click the 'B' to bubble sort. click the 'I' to Insert sort. so far, B sort is around 53-46 secs time, while I sort is around 13-15 secs. (for 20 items) Any computer scientists want to analyse the algorithm and put it into big O notation?

Project Details

Project ID1265983
CreatedAugust 26, 2010
Last ModifiedAugust 26, 2010
SharedAugust 26, 2010
Visibilityvisible
CommentsAllowed