0% found this document useful (0 votes)
39 views2 pages

Post-Quiz - AA Attempt Review

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

Post-Quiz - AA Attempt Review

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

 VIRAG NIMESHKUMAR DOSA…

 Dashboard / Algorithm Analysis and Design Concepts / Analysis of Algorithms / Post-Quiz

Started on Saturday, 10 April 2021, 6:41 PM


State Finished
Completed on Saturday, 10 April 2021, 6:45 PM
Time taken 4 mins 19 secs
Marks 5.00/5.00
Grade 100.00 out of 100.00
Feedback Congratulations!! You have passed by securing more than 80%

Question You have to sort a list 'L' which consists of some sorted elements and few “random” elements. Which of the following sorting methods
1 would be especially suitable for such a task?

Correct

Mark 1.00 out of


1.00
Select one:
Selection sort

Quick sort

Bubble sort

Insertion sort 

Your answer is correct.

The correct answer is: Insertion sort

Question What is the time complexity for executing merge sort on an array of size n which is already sorted is
2
Correct
Select one:
Mark 1.00 out of
1.00 O(n^2)

O(log n)

O(n log n) 

O(n)

Your answer is correct.

The correct answer is: O(n log n)

Question Rearrange the below algorithm for Bubble Sort.


3 Input: A is the list of elements and n is the size of the list
Output: A1, A2,...,An, arranged in increasing order
Correct

Mark 1.00 out of


1.00

 procedure bubbleSort(A,n)

 for i = 0 to n-1

 for j = 0 to n-i-1

 if A[j] >A[ j+1 ]

 swap a[j] <-> A[j+1]

 end bubbleSort

Your answer is correct.


 VIRAG NIMESHKUMAR DOSA…

Question
4 If the given array is {6,2, 5, 1, 9 }, the 3rd number from the left while doing bubble sort in the 2nd iteration is 5  .

Correct

Mark 1.00 out of


1.00

The correct answer is: 5

Question Time complexities of three algorithms are given. Which should execute the slowest for large values of N?
5
Correct
Select one:
Mark 1.00 out of
1.00 O(2N)

O(log N)

O(N)

O(n^2) 

Your answer is correct.

The correct answer is: O(n^2)

You might also like