COSC
ch8.png

# ch8.png - Quuon 1 for(int n=D n<1 n cfw for(int m=l3;m<10 m...

• Test Prep
• 1
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Quuﬁon 1 for (int n=D; n<1[}; n++) { for (int m=l3;m<10; m++) if (item[m] > item[n] ) { } } { } temp = item[m]; item[m] = item[n]; item[n] = temp; What is the sort effort (SE) the above algorithm? Selected Answer: C. rl2 Question 2 What is the worst-case time for mergonrt to sort an any of n elements? Selected Answer: C. O(n log n) Question 3 What do we NOT need to consider when choosing one of sorting algorithms? Selected Answer: D. the easiness to write the code Quaﬁon 4 What is the worst-case time for heap sort to sort an array of n elements? Selected Answer: A. 0(log n) Quaﬁon 5 The following is the list of features that the sorting algorithm analysis tedwniqua need to know, which one is NOT correct: Selected Answer: D. none of above Question 6 Bubble sort is: Selected B. Answer: 0 out of 0.4 points 0.4 out of 0.4 points 0 out of 0.4 points 0 out of 0.4 points 0.4 out of 0.4 points 0.4 out of 0.4 points The algorithm executes its sorting procus in die loop with each iteration referred as a pass, compare each pair of items from bottom to the topr ﬂue smaller items rise toward to the top of die anay. Each pass places one item into its ﬁnal position into array. ...
View Full Document

• Spring '16
• item, worst-case time

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern