Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following question and show how to do 22. The smallest worst-case complexity of a comparison-based sorting algorithm is: a) (log n) b) (n)

Answer the following question and show how to do
image text in transcribed
22. The smallest worst-case complexity of a comparison-based sorting algorithm is: a) (log n) b) (n) c) (n log n) d) (n) e) e () 23. Assuming a uniform distribution the worst case and average complexities of Insertion sort are: a) n/2 and -1/4 b) -nlogan and-logan/2 c) -4n and -2n d)-/2 and -1/4 e) -4/2 and -21 24. The worst-case complexity of Quicksort occurs when: a) The list is already sorted b) The largest element occurs in the first position c) The input list satisfies a uniform distribution d) The input list has large size e) None of the above 25. Which of the following sorting algorithms is not in-place: a) Bubble sort b) Insertion sort c) Mergesort d) Quicksort e) They are all in-place 26. The depth of a complete binary tree on n nodes is approximately equal to: a) 2" b) n logan c) logan d) ? 27. The depth of a complete binary tree having n leaf nodes is approximately equal to a) 2 b) n logan c) logan d) 28. Consider the array implementation of a complete binary tree in C++. For a node indexed by the indices the parent, left child and right child are respectively given by: a) I, 2*1,31 b) (I-1)2, 21 +1,2+ 2 c) 1-1,2*1,2*1 + 1 d) (1-1)/2,2*1,31 e) I-1,1+1 1+2 29. The total number of nodes of a 2-tree with 40 leaf nodes is: a) 40 b) 70 c) 79 d) 80 e) 89

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

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

Choose an appropriate organizational pattern for your speech

Answered: 1 week ago

Question

Writing a Strong Conclusion

Answered: 1 week ago