Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10. What is the worst-case time for mergesort to sort an array of n elements? a) O (n2) b) O (n) c) O (n lg

image text in transcribed

10. What is the worst-case time for mergesort to sort an array of n elements? a) O (n2) b) O (n) c) O (n lg n) d) O (n3) 11. Which sorting algorithm will perform best if the array is nearly sorted (only a very few items out of position)? a) Mergesort b) Selectionsort c) Insertionsort 12. Which sorting algorithm's runtime doesn't depend much on the ordering of the input? a) Bubblesort b) Selectionsort c) Insertionsort 13. We want to search the following sorted array using a binary search. Which numbers will the binary search check while looking for 3? 1 2 3 45 6 7 89 10 11 12 13 14 15 a) 8, 4, 2,3 b) 8, 12,14, 13 c) 7,3 d) 1, 2, 3 14. Where in memory would the parameters to main(i.e. argv and argc), be stored? a) The heap b) Static ram c) The runtime stack d) Program storage

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions