プレイ日記
MSWS coolestkid123
Bubble Sorting is slow, but I don't know how to code a better one.
5そうだね
プレイ済み
返信[1]
親投稿
Aaron Krondelo
I dont know how to do bubble sort, it seems overly complicated and takes a long time to find. Do you know any cases where it's best? Then again I only know linear sort.
0そうだね
プレイ済み
返信[2]
親投稿
V.G.Lover messi-416
sorry...noob question again.whats bubble sorting and what is it for?
0そうだね
プレイ済み
返信[3]
親投稿
MSWS coolestkid123
Bubble sorting actually is probably one or the simplest algorithms. Bubble sort basically looks at (from 0) each array item, and compares it to the one after that. If the one after it is bigger, swap the two values. It does this all the way to the end, until it's finished. Surprisingly easy to code.
0そうだね
プレイ済み
返信[4]
親投稿
MSWS coolestkid123
This basically is the sorting algorithm.
0そうだね
プレイ済み
返信[5]
親投稿
Aaron Krondelo
Apparently I've been doing bubble sort... I didn't know there was a swap function though. Most programming languages require the use of a temporary placeholder, so here is what it usually looks like.
0そうだね
プレイ済み
返信[6]
親投稿
MSWS coolestkid123
@Aaron Just a btw, you do know theres SORT and RSORT right?
0そうだね
プレイ済み
返信[7]
親投稿
Aaron Krondelo
Yeah I figured that out after writing this algorithm, no problem though iy's good practice.
0そうだね
プレイ済み