>
Exams
>
Data Science and Artificial Intelligence
>
Binary Operations
>
let f n denote the maximum number of comparisons m
Question:
Let F(n) denote the maximum number of comparisons made while searching for an entry in a sorted array of size n using binary search.
Which ONE of the following options is TRUE ?
GATE AR - 2024
GATE AR
Updated On:
Jul 9, 2024
F(n) = F(⌊n/2⌋) + 1
F(n) = F(⌊n/2⌋) + F(⌈n/2⌉)
F(n) = F(⌊n/2⌋)
F(n) = F(n - 1) + 1
Hide Solution
Verified By Collegedunia
The Correct Option is
A
Solution and Explanation
The correct option is (A) : F(n) = F(⌊n/2⌋) + 1.
Download Solution in PDF
Was this answer helpful?
0
0
Top Questions on Binary Operations
Consider a state space where the start state is number 1. The successor function for the state numbered n returns two states numbered n+1 and n+2. Assume that the states in the unexpanded state list are expanded in the ascending order of numbers and the previously expanded states are not added to the unexpanded state list.
Which ONE of the following statements about breadth-first search (BFS) and depth-first search (DFS) is true, when reaching the goal state number 6 ?
GATE AR - 2024
Data Science and Artificial Intelligence
Binary Operations
View Solution
The fundamental operations in a double-ended queue D are :
insertFirst (e) - Insert a new element e at the beginning of D.
insertLast (e) - Insert a new element e at the end of D.
removeFirst () - Remove and return the first element of D.
removeLast () - Remove and return the last element of D.
In an empty double-ended queue, the following operations are performed :
insertFirst (10)
insertLast (32)
a ← removeFirst()
insertLast (28)
insertLast (17)
a ←removeFirst()
a ← removeLast ()
The value of a is _______.
GATE AR - 2024
Data Science and Artificial Intelligence
Binary Operations
View Solution
Let H, I, L, and N represent height, number of internal nodes, number of leaf nodes, and the total number of nodes respectively in a rooted binary tree.
Which of the following statements is/are always TRUE ?
GATE AR - 2024
Data Science and Artificial Intelligence
Binary Operations
View Solution
View All
Questions Asked in GATE AR exam
For the beam shown below, ignoring the self-weight, the maximum hogging moment (in kN·m) generated for the loads indicated is _______ (rounded off to one decimal place).
GATE AR - 2024
High Rise and Long Span structures, gravity and lateral load resisting systems
View Solution
As per the Ekistics Logarithmic Scale, the 'world city' is referred as
GATE AR - 2024
Ekistics
View Solution
In 2021, a city survey report revealed a sex ratio of 930 with an estimated increase of 2.16% over the next 20 years. In 2041, the total population of the city is projected to be 15,00,000. The estimated female population in the year 2041 will be_______ (in integer)
GATE AR - 2024
Tools and techniques of Surveys
View Solution
Evaluate the following limit :
\(\lim\limits_{x\rightarrow0}\frac{\text{ln}((x^2+1)\cos x)}{x^2}\)
= ________.
GATE AR - 2024
Limits
View Solution
Two fair coins are tossed independently. X is a random variable that takes a value of 1 if both tosses are heads and 0 otherwise. Y is a random variable that takes a value of 1 if at least one of the tosses is heads and 0 otherwise.
The value of the covariance of X and Y is _________ (rounded off to three decimal places).
GATE AR - 2024
Random variables
View Solution
View More Questions