Category

Data Structures Algorithms-II MCQs


Which of the following is a disadvantage of linear search?


aRequires more space

✖


bGreater time complexities compared to other searching algorithms

✓


cNot easy to understand

✖


dNot easy to implement

✖



What is the best case and worst case complexity of ordered linear search?


aO(nlogn), O(logn)

✖


bO(logn), O(nlogn)

✖


c O(n), O(1)

✖


d O(1), O(n)

✓


View Answer O(1), O(n)

What is the worst case for linear search?


a O(nlogn)

✖


b O(logn)

✖


cO(n)

✓


dO(1)

✖


View Answer O(n)

What is the best case for linear search?


aO(nlogn)

✖


bO(logn)

✖


cO(n)

✖


dO(1)

✓


View Answer O(1)

Where is linear searching used?


aWhen the list has only a few elements

✖


bWhen performing a single search in an unordered list

✖


cUsed all the time

✖


dWhen the list has only a few elements and When performing a single search in an unordered list

✓



What is the recurrence relation for the linear search recursive algorithm?


a T(n-2)+c

✖


b 2T(n-1)+c

✓


c T(n-1)+c

✖


dT(n+1)+c

✖


View Answer 2T(n-1)+c

Can linear search recursive algorithm and binary search recursive algorithm be performed on an unordered list?


aBinary search can’t be used

✓


bLinear search can’t be used

✖


cBoth cannot be used

✖


dBoth can be used

✖



What is the best case runtime of linear search(recursive) algorithm on an ordered set of elements?


aO(1)

✓


b O(n)

✖


cO(logn)

✖


dO(nx)

✖


View Answer O(1)

The array is as follows: 1,2,3,6,8,10. Given that the number 17 is to be searched. At which call it tells that there’s no such element? (By using linear search(recursive) algorithm)


a 7th call

✓


b9th call

✖


c 17th call

✖


d The function calls itself infinite number of times

✖


View Answer 7th call

The array is as follows: 1,2,3,6,8,10. At what time the element 6 is found? (By using linear search(recursive) algorithm)


a4th call

✓


b 3rd call

✖


c 6th call

✖


d 5th call

✖


View Answer 4th call

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 © 2022, Designed & Developed by BolPakistan