Data Structures Algorithms-II MCQs

Page No. 89

What will be the time complexity of the code to reverse stack recursively?


aO(n)

✖


bO(n log n)

✖


cO(log n)

✖


dO(n2)

✓


View Answer O(n2)

Which of the following takes O(n) time in worst case in array implementation of stack?


a pop

✖


bpush

✖


cisEmpty

✖


dpop, push and isEmpty takes constant time

✓



What is the time complexity of the program to reverse stack when linked list is used for its implementation?


aO(n)

✓


b O(n log n)

✖


cO(n2)

✖


dO(log n)

✖


View Answer O(n)

Which of the following is considered as the top of the stack in the linked list implementation of the stack?


aLast node

✖


bFirst node

✓


cRandom node

✖


dMiddle node

✖


View Answer First node

Stack can be reversed without using extra space by _____________


ausing recursion

✖


busing linked list to implement stack

✓


c using an extra stack

✖


d it is not possible

✖



What is the space complexity of program to reverse stack recursively?


a O(1)

✖


bO(log n)

✖


cO(n)

✓


d O(n log n)

✖


View Answer O(n)

Which of the following statement is true about stack?


aPop operation removes the top most element

✓


bPop operation removes the bottom most element

✖


cPush operation adds new element at the bottom

✖


dPush operation removes the top most element

✖



What is the bidirectional variant of selection sort?


acocktail sort

✓


bbogo sort

✖


cgnome sort

✖


dbubble sort

✖


View Answer cocktail sort

What is the average case time complexity of recursive selection sort?


aO(n log n)

✖


bO(n log n)

✖


cO(n2)

✓


d O(log n)

✖


View Answer O(n2)

What will be the best case time complexity of recursive selection sort?


a O(n)

✖


bO(n2)

✓


cO(log n)

✖


dO(n log n)

✖


View Answer O(n2)

Goto Page No.

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