Data Structures Algorithms-II MCQs

Page No. 10

Which of the following sorting algorithm is best suited if the elements are already sorted?


aHeap Sort


b Quick Sort


c Insertion Sort


d Merge Sort


View Answer Insertion Sort

Which of the following is correct with regard to insertion sort?


ainsertion sort is stable and it sorts In-place


binsertion sort is unstable and it sorts In-place


c insertion sort is stable and it does not sort In-place


d insertion sort is unstable and it does not sort In-place



The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of iterations in selection sort and bubble sort respectively are __________


a5 and 4


b1 and 4


c0 and 4


d4 and 1


View Answer 4 and 1

The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively are __________


a5 and 4


b 4 and 5


c2 and 4


d2 and 5


View Answer 5 and 4

What is the disadvantage of selection sort?


a It requires auxiliary memory


bIt is not scalable


cIt can be used for small keys


d It takes linear time to sort the elements


View Answer It is not scalable

What is the advantage of selection sort over other sorting techniques?


aIt requires no additional storage space


bIt is scalable


cIt works best for inputs which are already sorted


dIt is faster than any other sorting technique



In the following scenarios, when will you use selection sort?


aThe input is already sorted


bThe input is already sorted


cLarge values need to be sorted with small keys


dSmall values need to be sorted with large keys



What is an in-place sorting algorithm?


a It needs O(1) or O(logn) memory to create auxiliary locations


b The input is already sorted and in-place


c It requires additional storage


d It requires additional space



The given array is arr = {1,2,4,3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array with improvised version?


a 4


b2


c1


d0


View Answer 2

The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will be done to sort the array?


a 4


b 2


c1


d 0


View Answer 4

Goto Page No.

Page 10 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