Data Structures Algorithms-II MCQs

Page No. 6

Exponential search algorithm requires which of the following condition to be true?


aarray should be sorted


barray should have not be sorted


carray should have a less than 128 elements


d array should be partially sorted



What are the updated values of high and low in the array if the element being searched is lower than the value at calculated index in interpolation search? (pos = current position)


a low = pos + 1, high remains unchanged


b high = pos – 1, low remains unchanged


c low = low +1, high = high – 1


dlow = pos +1, high = pos – 1



What are the updated values of high and low in the array if the element being searched is greater than the value at calculated index in interpolation search? (pos = current position)


alow = pos + 1, high remains unchanged


bhigh = pos – 1, low remains unchanged


clow = low +1, high = high – 1


dlow = pos +1, high = pos – 1



What is the formula used for calculating the position in interpolation search? (x = element being searched, A[] = input array, low and high are the leftmost and rightmost index of A[] respectively)


a((x – A[low]) * (high – low)) / (A[high] – A[low])


bhigh + ((x – A[low]) * (high – low)) / (A[high] – A[low])


clow + ((x – A[low]) * (high – low)) / (A[high] – A[low])


dx + ((x – A[low]) * (high – low)) / (A[high] – A[low])



Interpolation search has a better time complexity than exponential search for any given array.


aTrue


bFalse


cA & B


dNone of these


View Answer False

Interpolation search is an in place algorithm.


atrue


bfalse


cA & B


dNone of these


View Answer true

Which of the following searching algorithm is fastest when the input array is not sorted but has uniformly distributed values?


a jump search


blinear search


cbinary search


d interpolation search


View Answer linear search

Which of the following searching algorithm is fastest when the input array is sorted but has non uniformly distributed values?


ajump search


blinear search


c binary search


dinterpolation search


View Answer binary search

Which of the following searching algorithm is fastest when the input array is sorted and has uniformly distributed values?


a jump search


bexponential search


cbinary search


dinterpolation search


View Answer interpolation search

What is the time complexity of exponential search when the input array is sorted but the values are not uniformly distributed?


aO(n1/2)


bO(log log n)


c O(n)


dO(log n)


View Answer O(n1/2)

Goto Page No.

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