Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged binary-search
0
votes
1
answer
1
GATE DS&AI 2024 | Question: 30
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? $F(n)=F(\lfloor n / 2\rfloor)+1$ $F(n)=F(\lfloor n / 2\rfloor)+F(\lceil n / 2\rceil)$ $F(n)=F(\lfloor n / 2\rfloor)$ $F(n)=F(n-1)+1$
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 fo...
Arjun
889
views
Arjun
asked
Feb 16
Algorithms
gate-ds-ai-2024
algorithms
binary-search
+
–
4
votes
2
answers
2
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 18
Bob writes down a number between 1 and 1,000. Mary must identify that number by asking "yes/no" questions of Bob. Mary knows that Bob always tells the truth. If Mary uses an optimal strategy then she will determine that answer at the end of exactly how many questions on the worst case? 999 500 32 10
Bob writes down a number between 1 and 1,000. Mary must identify that number by asking "yes/no" questions of Bob. Mary knows that Bob always tells the truth. If Mary uses...
GO Classes
501
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
binary-search
1-mark
+
–
1
votes
0
answers
3
Memory Based GATE DA 2024 | Question: 19
Consider the function \(f(n)\), which represents the maximum number of comparisons in binary search on a sorted array of size \(n\). Which of the following recursive relationships correctly defines \(f(n)\)? \(f(n) = f\left(\lfloor \frac{n}{2} \rfloor\right) ... \rfloor\right)\) \(f(n) = f\left(\lfloor \frac{n}{2} \rfloor\right) + 1\) None of the above
Consider the function \(f(n)\), which represents the maximum number of comparisons in binary search on a sorted array of size \(n\). Which of the following recursive rela...
GO Classes
178
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
binary-search
recurrence-relation
+
–
0
votes
2
answers
4
Binary search is performed on a sorted array of n elements. The search key is not in the array and falls between the elements at positions m and m+1 (where 1 ≤ m < n). How many comparisons are needed in the worst case scenario to determine that the key is not in the array?
Binary search is performed on a sorted array of n elements. The search key is not in the array and falls between the elements at positions m and m+1 (where 1 ≤ m < n). ...
dhruba
1.2k
views
dhruba
asked
Jun 5, 2023
Algorithms
algorithms
binary-search
sorting
+
–
8
votes
3
answers
5
GO Classes Test Series 2023 | Algorithms | Test 1 | Question: 9
Given an unsorted array of $n$ distinct elements, you want to find this set of $\log n$ elements: those at positions $1,2,4,8,16, \ldots, n/2$ if array were sorted. In other words, find the largest element, the second largest element, the ... the subarray) $\Theta(\log n)$ $\Theta(n)$ $\Theta(n \log n)$ $\Theta\left(n^{2}\right)$
Given an unsorted array of $n$ distinct elements, you want to find this set of $\log n$ elements: those at positions $1,2,4,8,16, \ldots, n/2$ if array were sorted. In ot...
GO Classes
797
views
GO Classes
asked
Jun 13, 2022
Algorithms
goclasses2024-algo-1-weekly-quiz
goclasses
algorithms
searching
binary-search
2-marks
+
–
14
votes
4
answers
6
GATE CSE 2021 Set 2 | Question: 8
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size $n$? $\Theta ( \sqrt{n})$ $\Theta (\log _2(n))$ $\Theta(n^2)$ $\Theta(n)$
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size $n$?$\Theta ( \sqrt{n})$$\Theta (\log _2(n))$$\Theta...
Arjun
12.0k
views
Arjun
asked
Feb 18, 2021
Algorithms
gatecse-2021-set2
algorithms
binary-search
time-complexity
1-mark
+
–
3
votes
1
answer
7
NIELIT 2016 MAR Scientist C - Section C: 52
Consider the process of inserting an element into a $Max\ Heap$, where the $Max\ Heap$ is represented by an $array$. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of $comparisons$ ... $\Theta(n\log _{2} \log_2 n)$ $\Theta (n)$ $\Theta(n\log _{2}n)$
Consider the process of inserting an element into a $Max\ Heap$, where the $Max\ Heap$ is represented by an $array$. Suppose we perform a binary search on the path from ...
admin
2.0k
views
admin
asked
Apr 2, 2020
DS
nielit2016mar-scientistc
data-structures
binary-search
time-complexity
binary-heap
+
–
1
votes
1
answer
8
Made Easy Test Series
Given a sorted array of distinct integers A[1,2,3,..,n], the tightest upper bound to check the existence of any index i for which A[i]= i is equal to O($n^{a}log^{b}n)$. Then a+10b is equal to ___?
Given a sorted array of distinct integers A[1,2,3,..,n], the tightest upper bound to check the existence of any index i for which A[i]= i is equal to O($n^{a}log^{b}n)$. ...
Somoshree Datta 5
2.5k
views
Somoshree Datta 5
asked
Dec 31, 2018
Algorithms
binary-search
algorithms
made-easy-test-series
numerical-answers
+
–
10
votes
6
answers
9
TIFR CSE 2019 | Part A | Question: 5
Asha and Lata play a game in which Lata first thinks of a natural number between $1$ and $1000$. Asha must find out that number by asking Lata questions, but Lata can only reply by saying Yes or no . Assume that Lata always tells the truth. What is ... she can always find out the number Lata has thought of? $10$ $32$ $100$ $999$ $\text{None of the above}$
Asha and Lata play a game in which Lata first thinks of a natural number between $1$ and $1000$. Asha must find out that number by asking Lata questions, but Lata can onl...
Arjun
4.4k
views
Arjun
asked
Dec 18, 2018
Algorithms
tifr2019
algorithm-design
binary-search
+
–
1
votes
4
answers
10
Binary Search
There are two sorted list each of length n. An element to be searched in the both the lists. The lists are mutually exclusive. The maximum number of comparisons required using binary search and find its time complexity?
There are two sorted list each of length n. An element to be searched in the both the lists. The lists are mutually exclusive. The maximum number of comparisons required ...
Abhishek Kumar 38
2.1k
views
Abhishek Kumar 38
asked
Dec 15, 2018
Algorithms
data-structures
binary-search
+
–
2
votes
1
answer
11
GATEBOOK_DSA4_2
In which of the cases shown below, Binary search can not always be applied for searching (A) Hierarchical data record (B) Internet Domain name conversion (C) Searching a telephone number in directory (D) An array of integers Answer is given to be (D). I thought it must be (B). Please help. I understand (D) is okay when the array is not sorted.But what about other options?
In which of the cases shown below, Binary search can not always be applied for searching(A) Hierarchical data record (B) Internet Domain name conversion (C) Searching a t...
Ayush Upadhyaya
1.1k
views
Ayush Upadhyaya
asked
Nov 15, 2018
Programming in C
algorithms
binary-search
+
–
3
votes
0
answers
12
GATEBOOK-DSA4_8
Consider a sorted array A of n integer elements, A[0]...A[n − 1]. A search operation is to be performed on this array using .Binary search algorithm. If the element being searched is in fact the last element of the array, what is the difference between the index of element ... This is my answer.But it matches none of the options. Where I went wrong?
Consider a sorted array A of n integer elements, A[0]...A[n − 1].A search operation is to be performed on this array using .Binary search algorithm. If the element bein...
Ayush Upadhyaya
952
views
Ayush Upadhyaya
asked
Nov 15, 2018
Programming in C
data-structures
binary-search
algorithms
+
–
0
votes
1
answer
13
Algorithim
The average number of comparisons made by binary search for an unsuccessful search in array A
The average number of comparisons made by binary search for an unsuccessful search in array A
Sonali1996
1.3k
views
Sonali1996
asked
Sep 22, 2018
Algorithms
binary-search
+
–
0
votes
2
answers
14
Test Series
ben10
876
views
ben10
asked
Sep 9, 2018
Algorithms
algorithms
binary-search
recurrence-relation
ace-test-series
+
–
0
votes
1
answer
15
SELF DOUBT
https://gateoverflow.in/18752/tifr2010-b-29 IN THIS QUESTION WHY WE CANT NOT APPLY SINGLE BINARY SEARCH ON ENTIRE ARRAY ??? BECAUSE LET WE HAVE ARRAY 1 14 3 12 5 10 7 8 9 6 11 4 13 2 SUPPOSE WE NEED TO FIND 4 MID =7 AT MID THERE IS ODD NUMBER SO ... EVEN NUMBER ARE ARRANGED IN DESCENDING ORDER SO 4 WILL BE ON RIGHT OF 7 SO SIMILARLY WE CAN DO LIKE THAT.....IOS THIS APPROACH CORRECT??
https://gateoverflow.in/18752/tifr2010-b-29IN THIS QUESTION WHY WE CANT NOT APPLY SINGLE BINARY SEARCH ON ENTIRE ARRAY ???BECAUSE LET WE HAVE ARRAY 1 14 3 12 5 10 7 8 9 ...
eyeamgj
330
views
eyeamgj
asked
Sep 1, 2018
Algorithms
binary-search
algorithms
+
–
2
votes
4
answers
16
Binary Search
for binary search in an array of n elements the average number of searches is $\left \lfloor \log_{2}n \right \rfloor$ or $\left \lceil \log_{2}n \right \rceil$ ?
for binary search in an array of n elements the average number of searches is $\left \lfloor \log_{2}n \right \rfloor$ or $\left \lceil \log_{2}n \right \rceil$ ?
aditi19
2.6k
views
aditi19
asked
Aug 20, 2018
Algorithms
binary-search
+
–
0
votes
1
answer
17
Binary search
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is (A) (n) (B) (logn) (C) (log*n) (D) (1)
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is(A) (n)(B) (logn)(C) (log*n)(D) (1)
Sabir Khan
1.1k
views
Sabir Khan
asked
Aug 8, 2018
Algorithms
algorithms
sorting
binary-search
time-complexity
+
–
3
votes
1
answer
18
Ace Algorithms
Leading element in an array of n elements is the element which occurs more than n/2 times in the array. a) What is the time complexity to find whether a leading element exists or not in a sorted array of n elements? b)What is the time complexity to find ... between 0 to n? c)What is the time complexity to find whether leading element exists or not in an unsorted array of n elements?
Leading element in an array of n elements is the element which occurs more than n/2 times in the array.a) What is the time complexity to find whether a leading element ex...
Sambhrant Maurya
2.0k
views
Sambhrant Maurya
asked
Aug 6, 2018
Algorithms
algorithms
divide-and-conquer
binary-search
+
–
0
votes
1
answer
19
Made Easy Algorithms
How to calculate the time complexity for finding repeated elements in an array of n elements using linear search and binary search?
How to calculate the time complexity for finding repeated elements in an array of n elements using linear search and binary search?
Sambhrant Maurya
728
views
Sambhrant Maurya
asked
Aug 6, 2018
Algorithms
algorithms
time-complexity
binary-search
+
–
4
votes
7
answers
20
Searching
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive integer. a) O(logn) b) O(n) c)O(nlogn) d)O(n^2) Which of the option is Correct And Why?
Q) Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive int...
pradeepchaudhary
12.7k
views
pradeepchaudhary
asked
Jul 9, 2018
Algorithms
algorithms
sorting
time-complexity
binary-search
+
–
0
votes
1
answer
21
Binary search
Find the average number of comparisons in a binary search on a sorted array of 10 consecutive integers starting from 1. 1) 2.6 2)2.7 3)2.8 4)2.9
Find the average number of comparisons in a binary search on a sorted array of 10 consecutive integers starting from 1.1) 2.62)2.73)2.84)2.9
shweta sah
837
views
shweta sah
asked
Jun 22, 2018
Algorithms
binary-search
sorting
+
–
1
votes
1
answer
22
Drdo 2008
Binary search can be carried out on a set of ordered data items stored in a (A) Array (B) Stack (C) Queue (D) List
Binary search can be carried out on a set of ordered data items stored in a(A) Array (B) Stack (C) Queue (D) List
Shankar Jha
1.3k
views
Shankar Jha
asked
Jun 15, 2018
Algorithms
binary-search
+
–
3
votes
1
answer
23
Binary Search Question!
The average successful search time taken by binary search on a sorted array of 5 CONSECUTIVE integers starting with 1? My Answer is - 2.2 Kindly tell me is it correct or not? NOTE: I have edited the question and changes are shown in highlighted text.
The average successful search time taken by binary search on a sorted array of 5 CONSECUTIVE integers starting with 1?My Answer is - 2.2Kindly tell me is it correct or no...
iarnav
2.0k
views
iarnav
asked
Mar 13, 2018
Algorithms
algorithms
binary-search
+
–
3
votes
2
answers
24
Algorithms :- Binary search vs ternary search
Why to prefer binary search over ternary search?Can someone give recreance relation for ternary search,so that i can compare both
Why to prefer binary search over ternary search?Can someone give recreance relation for ternary search,so that i can compare both
rahul sharma 5
2.4k
views
rahul sharma 5
asked
Mar 8, 2018
Algorithms
binary-search
data-structures
algorithms
+
–
3
votes
0
answers
25
Interesting question on SQL
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing is available in ... If Binary Search is used to locate a tuple in a relation using primary key, then what is the range of n?
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored ...
Balaji Jegan
849
views
Balaji Jegan
asked
Jan 30, 2018
Databases
databases
sql
query
binary-search
+
–
1
votes
1
answer
26
binary search space complexity
Aditya Bahuguna
2.5k
views
Aditya Bahuguna
asked
Jan 7, 2018
Algorithms
binary-search
recursion
space-complexity
test-series
+
–
Page:
1
2
3
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register