Data Structures Algorithms-II MCQs

Page No. 91

Recursive solution of tower of hanoi problem is an example of which of the following algorithm?


aDynamic programming


bBacktracking


cGreedy algorithm


dDivide and conquer


View Answer Divide and conquer

Space complexity of recursive solution of tower of hanoi puzzle is ________


aO(1)


b O(n)


cO(log n)


dO(n log n)


View Answer O(n)

Minimum number of moves required to solve a tower of hanoi problem with n disks is __________


a2n


b2n-1


cn2


dn2-1


View Answer 2n-1

Recurrence equation formed for the tower of hanoi problem is given by _________


aT(n) = 2T(n-1)+n


bT(n) = 2T(n/2)+c


c T(n) = 2T(n-1)+c


dT(n) = 2T(n/2)+n


View Answer T(n) = 2T(n-1)+c

The time complexity of the solution tower of hanoi problem using recursion is _________


a O(n2)


bO(2n)


cO(n log n)


d O(n)


View Answer O(2n)

Which of the following is NOT a rule of tower of hanoi puzzle?


aNo disk should be placed over a smaller disk


bDisk can only be moved if it is the uppermost disk of the stack


cNo disk should be placed over a larger disk


dOnly one disk can be moved at a time



What is the objective of tower of hanoi puzzle?


aTo move all disks to some other rod by following rules


bTo divide the disks equally among the three rods by following rules


c To move all disks to some other rod in random order


dTo divide the disks equally among three rods in random order



Under what case of Master’s theorem will the recurrence relation of binary search fall?


a1


b2


c3


dIt cannot be solved using master’s theorem


View Answer 2

What is the result of the recurrences which fall under the extended second case of Master’s theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc(log n)k?


aT(n) = O(nlogba)


bT(n) = O(nc log n)


cT(n)= O(nc (log n)k+1


dT(n) = O(n2)


View Answer T(n)= O(nc (log n)k+1

Which case of master’s theorem can be extended further?


a1


b 2


c 3


dNo case can be extended


View Answer 2

Goto Page No.

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