Data Structures Algorithms-II MCQs

Page No. 15

Quick sort is a stable sorting algorithm.


a True


b False


cA & B


dNone of these


View Answer False

The best case behaviour occurs for quick sort is, if partition splits the array of size n into __________


an/2 : (n/2) – 1


bn/2 : n/3


c n/4 : 3n/2


d n/4 : 3n/4


View Answer n/2 : (n/2) – 1

Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element?


a6 4 3 7 11 9 14 12


b6 3 4 7 9 14 11 12


c 7 6 14 11 9 4 3 12


d 7 6 4 3 9 14 11 12


View Answer 6 3 4 7 9 14 11 12

Quick sort is a __________


agreedy algorithm


bdivide and conquer algorithm


c dynamic programming algorithm


dbacktracking algorithm



Which of the following is not true about QuickSort?


ain-place algorithm


bpivot position can be changed


cadaptive sorting algorithm


d can be implemented as a stable sort



The given array is arr = {2,6,1}. What are the pivots that are returned as a result of subsequent partitioning?


a1 and 6


b 6 and 1


c2 and 6


d1


View Answer 1

The given array is arr = {2,3,4,1,6}. What are the pivots that are returned as a result of subsequent partitioning?


a 1 and 3


b3 and 1


c2 and 6


d6 and 2


View Answer 1 and 3

What is a randomized QuickSort?


a The leftmost element is chosen as the pivot


b The rightmost element is chosen as the pivot


c Any element in the array is chosen as the pivot


dA random number is generated which is used as the pivot



QuickSort can be categorized into which of the following?


aBrute Force technique


bDivide and conquer


cGreedy algorithm


dDynamic programming


View Answer Divide and conquer

Which of the following is incorrect about randomized quicksort?


a it has the same time complexity as standard quick sort


bit has the same space complexity as standard quick sort


c it is an in-place sorting algorithm


dit cannot have a time complexity of O(n2) in any case.



Goto Page No.

Page 15 of 149

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan