Data Structures and Algorithms-I MCQs

Page No. 18

Given an array of element 5, 7, 9, 1, 3, 10, 8, 4. Which of the following are the correct sequences of elements after inserting all the elements in a min-heap?


a1,3,4,5,7,8,9,10


b1,4,3,9,8,5,7,10


c1,3,4,5,8,7,9,10


d1,3,7,4,8,5,9,10


View Answer 1,3,4,5,7,8,9,10

What is the location of a parent node for any arbitrary node i?


a(i/2) position


b(i+1)/ position


cfloor(i/2) position


dceil(i/2) position


View Answer floor(i/2) position

What is the best case complexity in building a heap?


aO(nlogn)


bO(2n)


cO(n*longn *logn)


dO(n)


View Answer O(n)

What is the space complexity of searching in a heap?


aO(logn)


bO(n)


cO(1)


dO(nlogn)


View Answer O(n)

The leaf node for a heap of height h will be at which position.


ah


bh-1


ch or h-1


dh-2


View Answer h or h-1

Does there exist a heap with seven distinct elements so that the Inorder traversal gives the element in sorted order.


aYes


bNo


ceither Yes either No


dNone of the mentioned


View Answer No

The total comparisons in finding both smallest and largest elements are


a2*n +2


bn + ((n+1)/2) -2


cn+logn


dn2


View Answer n + ((n+1)/2) -2

What is the worst case time in searching minimum value in weak -heap?


aO(log n)


bO(n)


cO(n logn)


dO(1)


View Answer O(1)

What is the other name of weak heap?


aMin-heap


bMax-heap


cRelaxed -heap


dLeonardo heap


View Answer Relaxed -heap

Left child of parent node has value lesser than the parent node.


aTrue


bFalse


ceither true either false


dNone of the mentioned


View Answer False

Goto Page No.

Page 18 of 53

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