ScratchData LogoScratchData
Back to readysteadycode's profile

Bubble Sort

REreadysteadycode•Created March 6, 2020
Bubble Sort
0
0
20 views
View on Scratch

Instructions

You can use the pick random operator to create a list of random numbers, but you often get duplicate numbers in the list. What I've done here is to create all the numbers from 1 to 100 randomly. Then I've chosen the first 10 of them and sorted them into a list beginning with the smallest. Bubble sorting compares them in pairs and moves the smallest to the front.

Description

This was easier in Scratch2 where the List INSERT block included a drop list that allowed you insert or delete an item in first, last or random place in the list. (In Scratch3, you need to use the pick random block and add +1 to list). See inside for code. You can also see an input bubble sort at https://scratch.mit.edu/projects/374479155

Project Details

Project ID374146161
CreatedMarch 6, 2020
Last ModifiedFebruary 10, 2022
SharedMarch 6, 2020
Visibilityvisible
CommentsAllowed