Data Structures and Algorithms-I MCQs

Page No. 3

Which node has the lowest priority in a treap?


aroot node

✓


bleaf node

✖


cnull node

✖


dcentre node

✖


View Answer root node

What is the average running time of a treap?


aO(N)

✖


bO(N log N)

✖


cO(log N)

✓


dO(M log N)

✖


View Answer O(log N)

Several other operations like union set difference and intersection can be done in treaps.


aTrue

✓


bFalse

✖


ceither true either false

✖


dNone of the mentioned

✖


View Answer True

What is the condition for priority of a node in a treap?


aa node’s priority should be greater than its parent

✖


ba node’s priority should be at least as large as its parent

✓


cthe priority is randomly assigned and can have any value

✖


da node’s priority is always given in decreasing order

✖



What is the reason behind the simplicity of a treap?


aEach node has data and a pointer

✖


bEach node is colored accordingly

✖


cIt is a binary search tree following heap principles

✖


dEach node has a fixed priority field

✓



Which is the simplest of all binary search trees?


aAVL tree

✖


bTreap

✓


cSplay tree

✖


dBinary heap

✖


View Answer Treap

A treap is a combination of a tree and a heap.


aTrue

✓


bFalse

✖


ceither true either false

✖


dNone of the mentioned

✖


View Answer True

What is the space complexity of a treap algorithm?


aO(N)

✓


bO(log N)

✖


cO(log N)

✖


dO(2N)

✖


View Answer O(N)

What are double and single threaded trees?


awhen both left, right nodes are having null pointers and only right node is null pointer respectively

✓


bhaving 2 and 1 node

✖


cusing single and double linked lists

✖


dusing heaps and priority queues

✖



Which of the following tree traversals work if the null left pointer pointing to the predecessor and null right pointer pointing to the successor in a binary tree?


ainorder, postorder, preorder traversals

✓


binorder

✖


cpostorder

✖


dpreorder

✖



Goto Page No.

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