Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Recent questions in Programming and DS
0
votes
1
answer
3581
Gate 2017 Set 1 minimum Comparisons
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required in worst case by optimal algorithm?
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required ...
yg92
224
views
yg92
asked
Feb 12, 2017
Programming in C
numerical-answers
algorithms
+
–
0
votes
0
answers
3582
pre-post increment
#include <stdio.h> int main(void) { int i,j,k,l; i=j=k=l=4; int a=(++i)*(++i)*(++i); int b = (j++)*(j++)*(j++); int c = (k++)*(++k)*(k++); int d = (l++)*(++l)*(++l); printf("%d\t%d\t%d\t%d",a,b,c,d); return 0; } Please explain the output. Thanks in advance. The output is: 252 64 125 150
#include <stdio.h>int main(void){int i,j,k,l;i=j=k=l=4;int a=(++i)*(++i)*(++i);int b = (j++)*(j++)*(j++);int c = (k++)*(++k)*(k++);int d = (l++)*(++l)*(++l);printf("%d\t%...
erh
645
views
erh
asked
Feb 9, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
3583
byron gottfried programming in c (schaum's outline) pageno:302 and 303
i wanted to intialize a 2d array using pointers to pointers and i wrote the following code i know the below code is lot of hardcoding but as i am a beginner to pointers i want to do it this way,please help me ... )+s)); } printf("\n"); } return 0; } https://gateoverflow.in/?qa=blob&qa_blobid=17604332813334679423
i wanted to intialize a 2d array using pointers to pointers and i wrote the following code i know the below code is lot of hardcoding but as i am a beginner to pointers i...
abhijeeth
605
views
abhijeeth
asked
Feb 8, 2017
Programming in C
programming-in-c
array-of-pointers
memory-management
+
–
0
votes
0
answers
3584
Depth first search
Consider the following graph G. Modified DFS on G applied as follows: • Starting vertex is ‘p’. • Vertex is visited based on alphabetic order. • Vertices are visited in order p, q, r, s, t, v. • It works same as DFS except the visiting order restriction What is the number of back edges during the above DFS traversal on G? a. 2 b. 3 c. 4 d. 5 Explain...how??
Consider the following graph G.Modified DFS on G applied as follows:• Starting vertex is ‘p’.• Vertex is visited based on alphabetic order.• Vertices are visite...
shraddha_gami
1.1k
views
shraddha_gami
asked
Feb 8, 2017
2
votes
1
answer
3585
Gatebook_Mocktest2(DS)
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only if N is composite. Assume that the bits array is initialized to all zeroes. for ( int x = 2; x < N ... a natural number n < N is prime. (A) I only (B) I and II only (C) II and III only (D) I, II, and III
The intended purpose of this code is to precompute all the primes less than N. When it is finished executing, for r ∈ [2, N), bits[r] is supposed to equal 1 if and only...
smartmeet
520
views
smartmeet
asked
Feb 8, 2017
DS
gatebook-mt2
data-structures
space-complexity
time-complexity
asymptotic-notation
+
–
1
votes
0
answers
3586
Gatebook_Mocktest2(DS)
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the current set such that|x-y| ≤ |xi-y| for all xi in the current set. Let where denotes the worst-case time ... to use in order to minimizeT? (A) A sorted list (B) An unordered list (C) An implicit heap (D) An AVL tree
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the curren...
smartmeet
366
views
smartmeet
asked
Feb 8, 2017
DS
gatebook-mt2
data-structures
avl-tree
+
–
0
votes
1
answer
3587
Hashing
If h is any hashing function and is used to hash n keys into a table of size m, here n<=m, the expected number of collisions involving a particular key x is a) Less than 1 b) Less than n c) Less than m d) Less than n/2
If h is any hashing function and is used to hash n keys into a table of size m, here n<=m, the expected number of collisions involving a particular key x isa) Less than 1...
smartmeet
4.6k
views
smartmeet
asked
Feb 8, 2017
DS
hashing
data-structures
chaining
uniform-hashing
+
–
0
votes
3
answers
3588
Data Structure In-Order Predecessor
If a node in a BST has two children, then its in-order predecessor has a) No left child b) No right child c) 2 children d) no child
If a node in a BST has two children, then its in-order predecessor hasa) No left childb) No right childc) 2 childrend) no child
smartmeet
7.0k
views
smartmeet
asked
Feb 8, 2017
DS
data-structures
tree
tree-traversal
+
–
4
votes
1
answer
3589
Balanced tree Minimum no of nodes for height h
dd
1.1k
views
dd
asked
Feb 8, 2017
DS
data-structures
binary-tree
numerical-answers
made-easy-test-series
+
–
4
votes
1
answer
3590
GateBook_MockTest2(Programming)
# include < stdio.h > main ( ) { float total 0.0, q = 1.0, p = 2.0; while (p/q> 0.001) { q = q + q ; total = total + p/q ; print f (“% f\n”, total) ; } } Which one of the following is the integer that best approximates the last number printed ? (A) 0 (B) 1 (C) 2 (D) 3
# include < stdio.h >main ( ){float total 0.0, q = 1.0, p = 2.0;while (p/q 0.001){q = q + q ;total = total + p/q ;print f (“% f\n”, total) ;}}Which one of the followi...
smartmeet
927
views
smartmeet
asked
Feb 7, 2017
Programming in C
programming-in-c
gatebook-mt2
+
–
0
votes
1
answer
3591
GateBook Mock Test_2(Data Structure)
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the current set such that|x-y| ≤ |xi-y| for all xi in the current set. Let where denotes the ... use in order to minimizeT? (A) A sorted list (B) An unordered list (C) An implicit heap (D) An AVL tree
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the curren...
smartmeet
460
views
smartmeet
asked
Feb 7, 2017
DS
data-structures
avl-tree
gatebook-mt2
+
–
6
votes
1
answer
3592
DS......
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the current set such that|x-y| ≤ |xi-y| for all xi in the current set. Let where denotes the worst-case time ... best to use in order to minimizeT? (A) A sorted list (B) An unordered list (C) An implicit heap (D) An AVL tree
Consider a data type whose elements are integers and whose operations are INSERT, DELETE, and FINDCLOSEST, with FINDCLOSEST(y) defined to be some element x in the curren...
srestha
1.0k
views
srestha
asked
Feb 7, 2017
DS
data-structures
+
–
0
votes
2
answers
3593
Choose the correct statement about HEAP
I. A heap is always nearly complete tree. II. Worst case complexity of heapify operation is O( log n) III. Worst case complexity of build heap operation is O( n log n) a. I only b. I and II only c. II and III only d. I, II and III
I. A heap is always nearly complete tree.II. Worst case complexity of heapify operation is O( log n)III. Worst case complexity of build heap operation is O( n log n)a. I ...
sh!va
4.2k
views
sh!va
asked
Feb 7, 2017
DS
data-structures
binary-heap
time-complexity
+
–
0
votes
2
answers
3594
MadeEasy Subject Test: Programming & DS - Binary Tree
varun singh
614
views
varun singh
asked
Feb 6, 2017
DS
made-easy-test-series
data-structures
binary-tree
time-complexity
+
–
0
votes
1
answer
3595
online quiz on khan academy
What is the asymptotic relationship between the function lgn and logn(base = 8)? options: 1.lgn = Big-oh(logn(base = 8)) 2.lgn = Omega(logn(base = 8)) 3.lgn = Theta(logn(base = 8)) 4.All
What is the asymptotic relationship between the function lgn and logn(base = 8)?options:1.lgn = Big-oh(logn(base = 8))2.lgn = Omega(logn(base = 8))3.lgn = Theta(logn(base...
bodabhavani
1.3k
views
bodabhavani
asked
Feb 6, 2017
1
votes
1
answer
3596
ME test
Consider a function AVLConstruction(). Which takes an array n elements as input in Ascending order and produce output as AVL tree for given array. AVLConstruction() function selects the median of the array and put it as the Root element. Recursively build Left subtree from the left half of ... array. what will be the complexity of AVLConstruction()? A) O(nlogn) B) O(n2) C) O(n3) D) O(n)
Consider a function AVLConstruction(). Which takes an array n elements as input in Ascending order and produce output as AVL tree for given array. AVLConstruction() funct...
Jithin Jayan
975
views
Jithin Jayan
asked
Feb 6, 2017
DS
data-structures
avl-tree
time-complexity
+
–
1
votes
1
answer
3597
Programming Output
Determine the output- #include <stdio.h> int main(void) { char *p="gateoverflow"; *(p+5)='z'; printf("%s",p); return 0; }
Determine the output-#include <stdio.h int main(void) { char *p="gateoverflow"; *(p+5)='z'; printf("%s",p); return 0; }
Samujjal Das
567
views
Samujjal Das
asked
Feb 6, 2017
Programming in C
programming-in-c
output
pointers
+
–
1
votes
0
answers
3598
True/False
Consider the following statements : S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1) time. S2 : In implementation of queue using stack, deletion of second element from front take Ο(1) time, when insertion take Ο(n) time. Which of the following is correct ? Only S1 Only S2 Both S1 and S2 None of the above
Consider the following statements :S1 : Implementation of stack using queue, deletion of second element from top of stack time complexity Ο(n), when insertion take Ο(1)...
reena_kandari
230
views
reena_kandari
asked
Feb 6, 2017
Programming in C
algorithms
+
–
0
votes
1
answer
3599
madeeasy
Given the input sequence {11, 33, 43, 99, 34, 79, 19} and hash table of size 10 with the hash function h(k) = k mod 10. If hash table uses quadratic probing, the number of collisions occurred while mapping the given sequence is ______.
Given the input sequence {11, 33, 43, 99, 34, 79, 19} and hash table of size 10 with the hash function h(k) = k mod 10. If hash table uses quadratic probing, the number o...
shefali1
730
views
shefali1
asked
Feb 5, 2017
1
votes
1
answer
3600
Space complexity
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls. A)insertion sort B)quick sort C)merge sort D)selection sort
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
reena_kandari
1.8k
views
reena_kandari
asked
Feb 5, 2017
Programming in C
algorithms
space-complexity
sorting
+
–
Page:
« prev
1
...
175
176
177
178
179
180
181
182
183
184
185
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register