Data Structures Algorithms-II MCQs

Page No. 29

Sleep sort works by ___________


a making elements to sleep for a time that is proportional to their magnitude


bmaking elements to sleep for a time that is inversely proportional to their magnitude


cpartitioning the input array


ddividing the value of input elements



In how many comparisons does the array arr={1,4,2,3,5} gets sorted if we use sleep sort?


a5


b3


c1


d0


View Answer 0

Sleep sort does not work for ___________


anegative numbers


blarge numbers


csmall numbers


d positive numbers


View Answer negative numbers

Which of the following header file is a must to implement sleep sort algorithm?


a string.h


bmath.hw


cbios.h


d windows.h


View Answer windows.h

Which of the following algorithm takes linear time for sorting?


apigeonhole sort


b heap sort


ccomb sort


dcycle sort


View Answer pigeonhole sort

What is the advantage of pigeonhole sort over merge sort?


apigeonhole sort has lesser time complexity when range is comparable to number of input elements


bpigeonhole sort has lesser space complexity


c counting sort is not a comparison based sorting technique


dpigeonhole sort is adaptive



Choose the correct statement from the following


apigeonhole sort is a comparison based sort


bany comparison based sorting can be made stable


cquick sort is not a comparison based sort


dany comparison based sort requires at least O(n2) time



What is the average time complexity of pigeonhole sort (k=range of input)?


aO(n)


bO(n+k)


cO(n2)


dO(n*k)


View Answer O(n+k)

Pigeonhole sort is an in place sorting algorithm.


a true


b false


cA & B


dNone of these


View Answer false

Pigeonhole sort is a stable sorting algorithm.


atrue


b false


cA & B


dNone of these


View Answer true

Goto Page No.

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