1) What does a sorting algorithm do? a) Puts only numbers in order b) Finds a bit of data c) Puts any data in order 2) How many times will the outer loop executed to arrange the list l=[23, 1,12, 43, 98] in ascending order using bubble sort a) 4 b) 2 c) 3 d) 5 3) The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 5, 13 in ascending order, using bubble sort is a) 11 b) 12 c) 13 d) 10 4) What will be the value of the list [8, 22, 7, 9, 31, 5, 13] after first pass a) 8, 7, 9, 22, 5, 13, 31 b) 7, 8, 9, 22, 5, 13, 31 c) 8, 7, 9, 5, 22, 31, 13 5) What are the correct intermediate steps of the following data set when it is being sorted with the bubble sort? 10,25,35,8 a) 10, 25, 8, 35 -- 10, 8, 25, 35 -- 8, 10, 25, 35 b) 10,25,35,8-- 8, 10, 35, 25-- 8, 10, 25, 35 c) 10, 25, 8, 35-- 8,10, 25, 35--8, 10, 25, 35 d) 10, 25, 8, 35-- 8, 10, 25, 35-- 10, 25, 8, 35-- 8, 10, 25, 35 6) In a bubble sort structure, there is/are? a) A single loop b) Three separate loops c) A while loop d) two nested loops 7) In bubble sort algorithm compares pairs of items and swaps them if they are in the wrong order. Each pair in the list is checked a) True b) False 8) What is the most important reason that data needs to be sorted? a) So it looks nice b) To show we can do it c) It is easier to make sense of 9) How do you calculate the maximum number of passes? Where n number of elements in a) n-1 b) n(n+1) c) n(n-1) d) n e) n+1 10) What does a bubble sort do? a) Separates a list of data into different b) Finds an item of data in a list c) Sorts a list by comparing two items that are side by side, to see which is out of order d) collections of data, before sorting and gathering back into a list
0%
Bubble sort
Share
Share
Share
by
Nidhi7
I-edit ang Content
I-Print kini
Embed
Uban pa
Assignments
Leaderboard
Show more
Show less
Kini nga leaderboard naka-pribado. Pag-klik sa
Share
aron himuon kini nga publiko.
Kini nga leaderboard gi-disable sa tag-iya sa resource.
Kini nga leaderboard gi-disable tungod ang imong mga kapilian lahi ra sa tag-iya sa resource.
I-revert ang mga Kapilian
Ang
Quiz
usa ka open-ended nga template. Dili kini makamugna ug mga marka sa leaderboard.
Kinahanglan mag log in
Visual style
Fonts
Subscription required
Mga Option
I-switch ang template
Ipakita tanan
Daghang mga format ang mugawas samtang gidula nimo ang activity.
Open results
Copy link
QR code
Mag-delete
I-restore ang gi-autosave:
?