Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged searching
8
votes
3
answers
1
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
799
views
GO Classes
asked
Jun 13, 2022
Algorithms
goclasses2024-algo-1-weekly-quiz
goclasses
algorithms
searching
binary-search
2-marks
+
–
1
votes
1
answer
2
NIELIT Scientific Assistant A 2020 November: 65
Finding the location of the element with a given value is : Traversal Search Sort None of the options
Finding the location of the element with a given value is :TraversalSearchSortNone of the options
gatecse
412
views
gatecse
asked
Dec 9, 2020
Algorithms
nielit-sta-2020
algorithms
searching
+
–
1
votes
3
answers
3
NIELIT 2017 DEC Scientist B - Section B: 8
Let $A$ be an array of $31$ numbers consisting of a sequence of $0$’s followed by a sequence of $1$’s. The problem is to find the smallest index $i$ such that $A[i]$ is $1$ by probing the minimum number of locations in $A$. The worst case number of probes performed by an optimal algorithm is $2$ $4$ $3$ $5$
Let $A$ be an array of $31$ numbers consisting of a sequence of $0$’s followed by a sequence of $1$’s. The problem is to find the smallest index $i$ such that $A[i]$ ...
admin
1.1k
views
admin
asked
Mar 30, 2020
Algorithms
nielit2017dec-scientistb
algorithms
searching
array
+
–
0
votes
1
answer
4
Cormen Edition 3 Exercise 2.3 Question 6 (Page No. 39)
Observe that the while loop of the INSERTION-SORT procedure uses a linear search to scan (backward) through the sorted subarray $A[i\dots j-1]$ Can we use a binary search (see Exercise 2.3-5) instead to improve the overall worst-case running time of insertion sort to $\Theta(n\ lg\ n)$?
Observe that the while loop of the INSERTION-SORT procedure uses a linear search to scan (backward) through the sorted subarray $A[i\dots j-1]$ Can we use a binary search...
akash.dinkar12
823
views
akash.dinkar12
asked
Jun 26, 2019
Algorithms
algorithms
cormen
searching
descriptive
+
–
0
votes
0
answers
5
Cormen Edition 3 Exercise 2.3 Question 5 (Page No. 39)
Referring back to the searching problem (see Exercise 2.1-3), observe that if the sequence $A$ is sorted, we can check the midpoint of the sequence against $v$ and eliminate half of the sequence from further consideration. The binary ... recursive, for binary search. Argue that the worst-case running time of binary search is $\Theta (lg\ n)$.
Referring back to the searching problem (see Exercise 2.1-3), observe that if the sequence $A$ is sorted, we can check the midpoint of the sequence against $v$ and elimin...
akash.dinkar12
351
views
akash.dinkar12
asked
Jun 26, 2019
Algorithms
cormen
algorithms
searching
descriptive
+
–
0
votes
1
answer
6
Cormen Edition 3 Exercise 2.2 Question 3 (Page No. 29)
Consider the linear search again (see Exercise 2.1-3). How many elements of the input sequence need to be checked on the average, assuming that the element being searched for is equally likely to be any element in the array? ... case? What are the average-case and worst-case running times of linear search in -notation? Justify your answers.
Consider the linear search again (see Exercise 2.1-3). How many elements of the input sequence need to be checked on the average, assuming that the element being searched...
akash.dinkar12
3.5k
views
akash.dinkar12
asked
Jun 25, 2019
Algorithms
cormen
algorithms
searching
descriptive
+
–
0
votes
0
answers
7
Cormen Edition 3 Exercise 2.1 Question 3 (Page No. 22)
Consider the searching problem: Input: A sequence of $n$ numbers $A = \langle a_1, a_2,\dots a_n \rangle$ and a value $v$ Output: An index $i$ such that $v=A[i]$ or the special value NIL if $v$ does ... $v$. Using a loop invariant, prove that your algorithm is correct. Make sure that your loop invariant fulfills the three necessary properties.
Consider the searching problem:Input: A sequence of $n$ numbers $A = \langle a_1, a_2,\dots a_n \rangle$ and a value $v$ Output: An index $i$ such that $v=A[i]$ or the s...
akash.dinkar12
435
views
akash.dinkar12
asked
Jun 25, 2019
Algorithms
cormen
algorithms
searching
descriptive
+
–
2
votes
1
answer
8
Vani Qs Bank Algorithms
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i. Ans should be O(log n) right by doing binary search ??
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i.Ans should be O(log n) right by do...
Hirak
1.3k
views
Hirak
asked
May 21, 2019
Algorithms
algorithms
array
searching
vani-booklet
+
–
1
votes
1
answer
9
Applied Course | Mock GATE | Test 1 | Question: 47
In a sorted file structure, let the cost of reading a page be $D=10$ milliseconds, the number of data pages be $B=1024$. Let the average time to process a record is $C=5$ milliseconds. Let the number of records ... the time taken to perform a search with equality selection? $10$ milliseconds $120$ milliseconds $5$ milliseconds $50$ milliseconds
In a sorted file structure, let the cost of reading a page be $D=10$ milliseconds, the number of data pages be $B=1024$. Let the average time to process a record is $C=5$...
Applied Course
612
views
Applied Course
asked
Jan 16, 2019
Algorithms
applied-course-2019-mock1
algorithms
searching
+
–
0
votes
1
answer
10
GATE Overflow | Mock GATE | Test 1 | Question: 32
A sequential search operation is performed on an array $A$ for the key value of $'x'$ (ignore quotes). Consider the following piece of assembly language code that uses back patching to perform the sequential search. i=0; P: if (i<A.length) goto ____; ... in the blanks provided ordered from top to bottom? R T U P R U T P P U T R P T U R
A sequential search operation is performed on an array $A$ for the key value of $'x'$ (ignore quotes). Consider the following piece of assembly language code that uses ba...
Ruturaj Mohanty
652
views
Ruturaj Mohanty
asked
Dec 27, 2018
Algorithms
go-mockgate-1
algorithms
searching
compiler-design
intermediate-code
code-optimization
+
–
2
votes
0
answers
11
Algorithm Searching
Which is faster and by how much, a linear search of only 1000 elements on a 5-GHz computer or a binary search of 1 million elements on a 1-GHz computer. Assume that the execution of each instruction on the 5-GHz computer is five times ... 1-GHz computer and that each iteration of the linear search algorithm is twice as fast as each iteration of the binary search algorithm.
Which is faster and by how much, a linear search of only 1000 elements on a 5-GHz computer or a binary search of 1 million elements on a 1-GHz computer. Assume that the e...
Vaishnavi01
428
views
Vaishnavi01
asked
Sep 23, 2018
Algorithms
algorithms
searching
+
–
1
votes
2
answers
12
what is the expected number of comparisons made before the algorithm terminates ?
radha gogia
896
views
radha gogia
asked
Aug 7, 2018
Algorithms
algorithms
searching
normal
test-series
+
–
1
votes
1
answer
13
Ace Algorithms
Suppose A is a sorted array and some of the elements are duplicates. What is the best upper bound to find out the number of elements that are equal to a given key 'k' a) O(log n) b) O(n) c) O(nlogn) d) O(n2)
Suppose A is a sorted array and some of the elements are duplicates. What is the best upper bound to find out the number of elements that are equal to a given key 'k'a)...
Sambhrant Maurya
771
views
Sambhrant Maurya
asked
Aug 7, 2018
Algorithms
algorithms
searching
+
–
0
votes
0
answers
14
Better Algorithm for aggregating data from LDAP Systems
This question is not related to GATE, but certainly would help you to grill your mind to come up with a better approach.. Feel free to comment if you think, this is not a right forum for this question. I have 10 ... format cannot be changed as there is dependency with other downstream systems. Is there a better approach to achieve the same ?
This question is not related to GATE, but certainly would help you to grill your mind to come up with a better approach.. Feel free to comment if you think, this is not a...
Arunav Khare
284
views
Arunav Khare
asked
May 14, 2018
Programming in C
algorithms
searching
+
–
0
votes
1
answer
15
Uttrakhand Asst. Professor Exam-19
Which of the following search method takes less memory ? Depth-first search Breadth-first search Linear search None of the above
Which of the following search method takes less memory ? Depth-first search Breadth-first search Linear search None of the above
gatecse
1.3k
views
gatecse
asked
Mar 2, 2018
Unknown Category
uttarakhand-asst-prof-2018
data-structures
searching
+
–
56
votes
10
answers
16
GATE CSE 2017 Set 1 | Question: 48
Let $A$ be an array of $31$ numbers consisting of a sequence of $0$'s followed by a sequence of $1$'s. The problem is to find the smallest index $i$ such that $A\left [i \right ]$ is $1$ by probing the minimum number of locations in $A$. The worst case number of probes performed by an optimal algorithm is ____________.
Let $A$ be an array of $31$ numbers consisting of a sequence of $0$'s followed by a sequence of $1$'s. The problem is to find the smallest index $i$ such that $A\left [i ...
Arjun
21.8k
views
Arjun
asked
Feb 14, 2017
Algorithms
gatecse-2017-set1
algorithms
normal
numerical-answers
searching
+
–
0
votes
0
answers
17
MadeEasy Advance Test Series: Algorithm - Searching
can someone provide me the detailed description for this answer?
can someone provide me the detailed description for this answer?
S Ram
327
views
S Ram
asked
Feb 1, 2017
Algorithms
made-easy-test-series
algorithms
searching
+
–
3
votes
3
answers
18
UGC NET CSE | December 2014 | Part 3 | Question: 56
An $A^{*}$ algorithm is a heuristic search technique which Is like a depth-first search where most promising child is selected for expansion Generates all successor nodes and computes an estimate of distance (cost) from start node ... (costs) from start node to all generated nodes and chooses shortest path for further expansion. None of the above
An $A^{*}$ algorithm is a heuristic search technique whichIs like a depth-first search where most promising child is selected for expansion Generates all successor nodes ...
makhdoom ghaya
2.8k
views
makhdoom ghaya
asked
Jul 30, 2016
Others
ugcnetcse-dec2014-paper3
artificial-intelligence
searching
+
–
24
votes
3
answers
19
GATE CSE 2008 | Question: 85
Consider the following C program that attempts to locate an element $x$ in an array $Y[ \ ]$ using binary search. The program is erroneous. f (int Y[10] , int x) { int i, j, k; i= 0; j = 9; do { k = (i + j) / 2; if( Y[k] < x) i = k;else j = k; } while (Y[k] ... if $(Y[k] < x) i = k$; else $j = k$; Change line 7 to: } while $((Y[k] == x) \&\& (i < j))$ ;
Consider the following C program that attempts to locate an element $x$ in an array $Y[ \ ]$ using binary search. The program is erroneous. f (int Y[10] , int x) { int i,...
go_editor
7.1k
views
go_editor
asked
Apr 23, 2016
Algorithms
gatecse-2008
algorithms
searching
normal
+
–
3
votes
2
answers
20
ISRO2011-70
Number of comparisons required for an unsuccessful search of an element in a sequential search organized, fixed length, symbol table of length L is L L/2 (L+1)/2 2L
Number of comparisons required for an unsuccessful search of an element in a sequential search organized, fixed length, symbol table of length L isLL/2(L+1)/22L
ajit
6.9k
views
ajit
asked
Oct 1, 2015
Algorithms
isro2011
algorithms
searching
+
–
24
votes
2
answers
21
GATE CSE 1996 | Question: 18
Consider the following program that attempts to locate an element $x$ in an array $a[ ]$ using binary search. Assume $N > 1$. The program is erroneous. Under what conditions does the program fail? var i,j,k: integer; x: integer; a: array; [1..N] of ... ; if (a[k] = x) then writeln ('x is in the array') else writeln ('x is not in the array') end;
Consider the following program that attempts to locate an element $x$ in an array $a[ ]$ using binary search. Assume $N 1$. The program is erroneous. Under what conditio...
Kathleen
3.5k
views
Kathleen
asked
Oct 9, 2014
Algorithms
gate1996
algorithms
searching
normal
descriptive
+
–
56
votes
8
answers
22
GATE CSE 1996 | Question: 2.13, ISRO2016-28
The average number of key comparisons required for a successful search for sequential search on $n$ items is $\frac{n}{2}$ $\frac{n-1}{2}$ $\frac{n+1}{2}$ None of the above
The average number of key comparisons required for a successful search for sequential search on $n$ items is$\frac{n}{2}$$\frac{n-1}{2}$$\frac{n+1}{2}$None of the above
Kathleen
31.7k
views
Kathleen
asked
Oct 9, 2014
Algorithms
gate1996
algorithms
easy
isro2016
searching
+
–
71
votes
11
answers
23
GATE CSE 2002 | Question: 2.10
Consider the following algorithm for searching for a given number $x$ in an unsorted array $A[1..n]$ having $n$ distinct values: Choose an $i$ at random from $1..n$ If $A[i] = x$, then Stop else Goto 1; Assuming that $x$ is present in $A$, what is the expected number of comparisons made by the algorithm before it terminates? $n$ $n-1$ $2n$ $\frac{n}{2}$
Consider the following algorithm for searching for a given number $x$ in an unsorted array $A[1..n]$ having $n$ distinct values:Choose an $i$ at random from $1..n$If $A[i...
Kathleen
22.3k
views
Kathleen
asked
Sep 15, 2014
Algorithms
gatecse-2002
searching
normal
+
–
47
votes
5
answers
24
GATE CSE 2008 | Question: 84
Consider the following C program that attempts to locate an element $x$ in an array $Y[ \ ]$ using binary search. The program is erroneous. f (int Y[10] , int x) { int i, j, k; i= 0; j = 9; do { k = (i+ j) / 2; if( Y[k] < x) i = k;else j = k; } while (Y[k] != x ... $Y$ is $[2 \ 4 \ 6 \ 8 \ 10 \ 12 \ 14 \ 16 \ 18 \ 20]$ and $ 2 < x < 20$ and $x$ is even
Consider the following C program that attempts to locate an element $x$ in an array $Y[ \ ]$ using binary search. The program is erroneous. f (int Y[10] , int x) { int i,...
Kathleen
21.5k
views
Kathleen
asked
Sep 11, 2014
Algorithms
gatecse-2008
algorithms
searching
normal
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register