The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged binarysearch
+2
votes
1
answer
1
How many Binary Search Trees are possible for a labelled nodes?
Let us there are n nodes which are labelled. Then the number of trees possible is given by the Catalan Number i.e $\binom{2n}{n} / (n+1)$ Then the binary search trees possible is just 1?
asked
Jan 16
in
DS
by
sripo
Active
(
2.3k
points)

324
views
algorithms
graphtheory
binarysearchtree
binarysearch
binarytree
trees
datastructure
+1
vote
1
answer
2
TIFR2019A5
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 the least ... within which she can always find out the number Lata has thought of? $10$ $32$ $100$ $999$ $\text{None of the above}$
asked
Dec 18, 2018
in
Algorithms
by
Arjun
Veteran
(
416k
points)

323
views
tifr2019
algorithmdesign
binarysearch
0
votes
0
answers
3
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?
asked
Dec 15, 2018
in
Algorithms
by
Abhishek Kumar 38
(
81
points)

176
views
datastructure
binarysearch
+1
vote
0
answers
4
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?
asked
Nov 15, 2018
in
Programming
by
Ayush Upadhyaya
Boss
(
25.5k
points)

135
views
algorithms
binarysearch
+1
vote
0
answers
5
GATEBOOKDSA4_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?
asked
Nov 15, 2018
in
Programming
by
Ayush Upadhyaya
Boss
(
25.5k
points)

125
views
datastructure
binarysearch
algorithms
+1
vote
4
answers
6
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$ ?
asked
Aug 20, 2018
in
Algorithms
by
aditi19
Active
(
4k
points)

378
views
binarysearch
+1
vote
1
answer
7
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?
asked
Aug 7, 2018
in
Algorithms
by
Sambhrant Maurya
Active
(
2.4k
points)

253
views
algorithms
divideandconquer
binarysearch
0
votes
1
answer
8
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?
asked
Aug 6, 2018
in
Algorithms
by
Sambhrant Maurya
Active
(
2.4k
points)

153
views
algorithms
timecomplexity
binarysearch
+1
vote
4
answers
9
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 ab = 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?
asked
Jul 9, 2018
in
Algorithms
by
pradeepchaudhary
Active
(
1.2k
points)

775
views
algorithms
sorting
timecomplexity
binarysearch
+2
votes
1
answer
10
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.
asked
Mar 13, 2018
in
Algorithms
by
iarnav
Loyal
(
8k
points)

443
views
algorithms
binarysearch
+1
vote
1
answer
11
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
asked
Mar 8, 2018
in
Algorithms
by
rahul sharma 5
Boss
(
24.5k
points)

470
views
binarysearch
datastructure
algorithms
+3
votes
0
answers
12
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?
asked
Jan 31, 2018
in
Databases
by
Balaji Jegan
Active
(
4.8k
points)

209
views
databases
sql
query
binarysearch
+3
votes
1
answer
13
ACE Test Series
asked
Jan 18, 2018
in
Algorithms
by
ankit_thawal
Active
(
1.4k
points)

205
views
binarysearch
+3
votes
2
answers
14
Binary Search
Suppose we have the following sorted list: [3, 5, 6, 8, 11, 12, 14, 15, 17, 18] and array data structure is used. We are using recursive binary search algorithm to search an element 8. Which of the following group of number correctly shown the sequence of comparison used to find element 8? (Assume array index starting with 0). a) 11,5,6,8 b) 12,6,11,8
asked
Dec 8, 2017
in
Algorithms
by
VS
Loyal
(
10k
points)

451
views
binarysearch
+4
votes
3
answers
15
Number of binary search trees
How many different binary search trees can be constructed using six distinct keys? 256 128 132 264
asked
Nov 27, 2017
in
DS
by
Parshu gate
Active
(
3.1k
points)

684
views
binarytree
binarysearch
binarysearchtree
+3
votes
1
answer
16
Ace Test Series: Algorithms  Searching
asked
Nov 23, 2017
in
Algorithms
by
saxena0612
Boss
(
11.7k
points)

462
views
binarysearch
algorithms
acetestseries
searching
+7
votes
2
answers
17
Question on sorted array and time complexity
Which of the following operations can be performed in O(log n) time or faster on a sorted array A? (n denotes the size of array) 1) Search(A, x) 2) FindMinimum(A) 3) Delete(A, x) Choose the correct option: A.) 1 & 3 B.) 1 & 2 C.) 2 & 3 D.) All of them I chose option B but the book says option D is right. Please provide an explanation.
asked
Nov 22, 2017
in
Algorithms
by
Akash Mishra
Active
(
1.3k
points)

1k
views
algorithms
sorting
timecomplexity
binarysearch
+2
votes
0
answers
18
Binary Search
In this given question I find all answers false because while implementing binary seach or tracing it for an example we need to follow same approach Right? if we are taking ceil for evaluation then it should be considered throughout and if we are ... should be traced.Therefore applying both operating individually I find none of the options matching. Correct Me If I am wrong here.
asked
Nov 16, 2017
in
Algorithms
by
saxena0612
Boss
(
11.7k
points)

213
views
binarysearch
algorithms
+4
votes
1
answer
19
Binary search on two mutually exclusive arrays.
There are two sorted list each of length $n$ ... the search the moment we find the element. So tell me whose solution is correct? Why my solution should be incorrect?
asked
Nov 6, 2017
in
Algorithms
by
Aghori
Loyal
(
6.1k
points)

326
views
binarysearch
algorithms
datastructure
timecomplexity
+5
votes
2
answers
20
Selfdoubt
Which of the following is exact recurrence relation for binary search (in terms of number of comparisons) ? 1. T(n) = 2T(n/2) + 1 2. T(n) = 2T(n/2) + 2 Please specify relevant reasons.
asked
Aug 22, 2017
in
Algorithms
by
just_bhavana
Boss
(
12k
points)

480
views
binarysearch
+9
votes
3
answers
21
Modified Binary Search
Suppose the first step in binary search algorithm is changed to M = (9L+R)/10, we know that the complexity of binary search is log(n). What will be the complexity of modified search? a) log(n) b) n c) n$\log 9/10(n)$ d) 2nlog(n)
asked
Aug 16, 2017
in
DS
by
Chandramani Adil
(
145
points)

565
views
timecomplexity
binarysearch
+6
votes
5
answers
22
Binary search
How to get space complexity of binary search .. I am getting confusion in Space complexity = ip + extra (stack) And ip = nB ( why it is nB) ????? And extra = logn B So nB+ log n B = O(n) ...
asked
Aug 10, 2017
in
Algorithms
by
air1ankit
Active
(
4.2k
points)

728
views
algorithms
binarysearch
+5
votes
4
answers
23
Binary Search
I/p  Sorted array of n element O/p find any two elements a and b such that (a+b)>1000 if lenear search is possible then go to Binary Search and Find time complexity ..?
asked
Jun 28, 2017
in
Algorithms
by
Raushank2
Active
(
1.1k
points)

621
views
algorithms
binarysearch
timecomplexity
+4
votes
1
answer
24
Difference between finding Inorder Successor vs finding next using Inorder Traversal in BST
asked
Jun 25, 2017
in
Algorithms
by
rahulsangwn
(
301
points)

384
views
algorithms
binarytree
binarysearch
binarysearchtree
+8
votes
2
answers
25
Self doubt in Binary search Algo
The average successful search time taken by binary search on a sorted array of $10$ items? $2.6$ $2.7$ $2.8$ $2.9$ Answer is $2.9$ My doubt: But when I am using $log_2n$ for $n = 10$ it is not equal to $2.9$, and $log_210 = 3.3219$ ?
asked
Jun 6, 2017
in
Algorithms
by
Shubhanshu
Boss
(
18k
points)

1.5k
views
algorithms
binarysearch
timecomplexity
+6
votes
3
answers
26
binary search
I/p  array of n element in which untill some postion all are integer and afterward all are star (*) O/p find the postion of 1st star (*) Hint  if lenear search is possible the go to BS Find time complexity ..?
asked
Mar 9, 2017
in
Algorithms
by
air1ankit
Active
(
4.2k
points)

611
views
algorithms
binarysearch
binarysearchtree
+1
vote
1
answer
27
Time complexity to compute the sum of k smallest element in the binary search tree??
asked
Feb 2, 2017
in
Programming
by
sushmita
Boss
(
16.5k
points)

655
views
binarysearch
binarysearchtree
Page:
1
2
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
ISI MTECH CS 2019 INTERVIEW EXPERIENCE
IIT HYDERABAD MTECH TA INTERVIEW EXPERIENCE
How to prepare for GATE with a fulltime job??
Interview Experience at IISc
All subject Gate notes from Standard Books!!
Follow @csegate
Recent questions tagged binarysearch
Recent Blog Comments
Refund time depends on the payment mode ...
@Arjun Sir , when can i expect my refund in the...
This book is returned you can enable a pay now...
@Pranavcool The book stocks are over and no one...
@Lokesh Thats unfortunate. I have refunded you....
49,830
questions
54,802
answers
189,511
comments
80,747
users