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
Most viewed questions in Programming and DS
2
votes
3
answers
2371
Problem on TOH
We solve TOH problem recursively breaking the task in three sections, which of the following recurrence will accord well with the approach , that is shows correct order of work done on each recursive step A) T(n)=T(n-1)+1+T(n-1) B) T(n)=T(n-1)+T(n-1)+1 C) T(n)=1+T(n-1)+T(n-1) D) T(n)=T(n-1)+T(n-1)+2
We solve TOH problem recursively breaking the task in three sections, which of the following recurrence will accord well with the approach , that is shows correct order o...
srestha
765
views
srestha
asked
Nov 11, 2017
DS
data-structures
stack
recurrence-relation
+
–
6
votes
2
answers
2372
Test by Bikram | Data Structures | Test 2 | Question: 20
A sorting technique is called to sort a list of $100$ integers that have been read from a file. If all $100$ values are zero, what would be the execution requirement(in terms of Big -O) if the sort used was selection sort ? $O(N)$ $O(\log N)$ $O(N^2)$ $O(1)$
A sorting technique is called to sort a list of $100$ integers that have been read from a file. If all $100$ values are zero, what would be the execution requirement(in t...
Bikram
765
views
Bikram
asked
Nov 26, 2016
Programming in C
tbb-ds-2
+
–
1
votes
1
answer
2373
Time Complexity
What is the time complexity of quick sort when (i) Choosing median of sorted array as pivot.
What is the time complexity of quick sort when (i) Choosing median of sorted array as pivot.
srestha
764
views
srestha
asked
Jan 11, 2017
1
votes
2
answers
2374
How is 2D array passed to a function having formal parameter as a pointer to a array of elements ?
when I am passing a 2D array and function is declared like func(int a[][6]) //This implies that a is going to an array of 6 columns ,rght now we don't know the rows fine ,but it is pointing to a 2D ... I am unable to get the exact way in this pointer a would be pointing to the 2D array .
when I am passing a 2D array and function is declared likefunc(int a[][6]) //This implies that a is going to an array of 6 columns ,rght now we don't know the rows fine ,...
radha gogia
764
views
radha gogia
asked
Sep 24, 2015
Programming in C
programming-in-c
+
–
6
votes
2
answers
2375
MadeEasy Test Series: Programming & DS - Heap
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
Vishal Goyal
763
views
Vishal Goyal
asked
Dec 6, 2016
DS
made-easy-test-series
data-structures
binary-heap
+
–
1
votes
1
answer
2376
Which of the following in correct
Assume that there are two lower triangular matrices A and B of size n*n. If matrix A and transpose of B are fit into a rectangular matrix C of size n*(n+1), then a) B[i,j]=C[i,j+1] b)B[i,j]=C[j+1,i] c)B[i,j]=C[j, i+1]
Assume that there are two lower triangular matrices A and B of size n*n. If matrix A and transpose of B are fit into a rectangular matrix C of size n*(n+1), thena) B[i,j]...
gshivam63
763
views
gshivam63
asked
Jun 1, 2016
0
votes
1
answer
2377
Tree DS
1. How many Binary trees can be made with: (a) 3 unlabelled nodes? (b) 3 labelled nodes? 2. How many Binary Search trees can be made with: (a) 3 unlabelled nodes? (b) 3 labelled nodes? 3. How many AVL trees can be made with: (a) 3 unlabelled nodes? (b) 3 labelled nodes? Can these be generalised for 'n' nodes?
1. How many Binary trees can be made with:(a) 3 unlabelled nodes?(b) 3 labelled nodes?2. How many Binary Search trees can be made with:(a) 3 unlabelled nodes?(b) 3 labell...
Naveen Kumar 3
762
views
Naveen Kumar 3
asked
Aug 4, 2018
DS
data-structures
tree
+
–
1
votes
1
answer
2378
Constant Pointer
Please tell me about all the variations of these above types of questions that can be asked?
Please tell me about all the variations of these above types of questions that can be asked?
Na462
762
views
Na462
asked
May 4, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2379
MadeEasy Subject Test: Programming & DS - Heap
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
sunaina rawat
762
views
sunaina rawat
asked
Nov 7, 2017
DS
made-easy-test-series
data-structures
binary-heap
+
–
0
votes
1
answer
2380
tree traversal
when is it possible in binary search tree that (preorder,inorder) ,(postorder,inorder),and (preorder,postorder) are equal.please explain AND what about binary tree
when is it possible in binary search tree that (preorder,inorder) ,(postorder,inorder),and (preorder,postorder) are equal.please explain AND what about binary tree
Nishikant kumar
762
views
Nishikant kumar
asked
Jul 19, 2015
2
votes
2
answers
2381
GATE Overflow | Data Structures | Test 1 | Question: 22
A function $f$ defined on stack of integer satisfies the following properties: $f(\{\}) = 1$ and $f(PUSH(S,i)) = \max (f(S),1) * i$ for all stacks $S$ and integer $i$. If a stack $S$ contains the integers $4, -2, 9$ in order from bottom to top, what is $f(S)$?
A function $f$ defined on stack of integer satisfies the following properties:$f(\{\}) = 1$ and$f(PUSH(S,i)) = \max (f(S),1) * i$ for all stacks $S$ and integer $i$.If a ...
Arjun
761
views
Arjun
asked
Oct 10, 2016
DS
go-ds-1
data-structures
stack
numerical-answers
+
–
1
votes
1
answer
2382
google
main() { int a; scanf("%i"&a); printf("%i %d",a,a); scanf("%d",&a); printf("%i %d",a,a); } suppose user entered 0101 as input .what is printed by above program?
main(){int a;scanf("%i"&a);printf("%i %d",a,a);scanf("%d",&a);printf("%i %d",a,a);}suppose user entered 0101 as input .what is printed by above program?
eyeamgj
760
views
eyeamgj
asked
Nov 22, 2017
Programming in C
programming-in-c
non-gate
+
–
2
votes
1
answer
2383
explain the output
main( ) { char ch = 200 ; printf ( "\n%d", ch ) ; }
main( ){char ch = 200 ;printf ( "\n%d", ch ) ;}
Parshu gate
760
views
Parshu gate
asked
Nov 12, 2017
Programming in C
programming-in-c
+
–
2
votes
2
answers
2384
what will be the output?
#include<stdio.h> #include<stdlib.h> int main() { struct xx { int x; char s; }; struct xx *t; t->x=5; t->s='a'; printf("%d %c\n", t->x, t->s); }
#include<stdio.h #include<stdlib.h int main() { struct xx { int x; char s; }; struct xx *t; t->x=5; t->s='a'; printf("%d %c\n", t->x, t->s); }
Manali Sikdar
760
views
Manali Sikdar
asked
Sep 7, 2014
Programming in C
pointers
easy
+
–
3
votes
1
answer
2385
const pointer
The output of below code is_______________. int main() { int i = 120; int *a = &i; foo(&a); printf("%d ", *a); printf("%d ", *a); } void foo(int **const a) { int j = 210; *a = &j; printf("%d ", **a); }
The output of below code is_______________. int main() { int i = 120; int *a = &i; foo(&a); printf("%d ", *a); printf("%d ", *a); } void foo(int const a) { int j = 210; ...
Hira Thakur
759
views
Hira Thakur
asked
Jun 14, 2017
Programming in C
programming-in-c
const
+
–
0
votes
2
answers
2386
How to represent int a=7 in little endian architecture computer.
I saw on http://www.cquestions.com/2009/06/memory-representation-of-int-data-type.html but it seems wrong to me. Please clarify.
I saw on http://www.cquestions.com/2009/06/memory-representation-of-int-data-type.html but it seems wrong to me. Please clarify.
Narayan Kunal
759
views
Narayan Kunal
asked
Sep 4, 2014
0
votes
1
answer
2387
IIIT BLR TEST 1 : ALGORITHMS 2
A 3 way (ternary) min heap is a 3 way ( ternary - each node as atmost three children nodes, left, mid, right ) complete tree with min heap property ( value of the parent is less than the value of the children ) satisfied at every node ... c) In Heapsort, binary heap is preferred over ternary heap. State if this statement is true or false, you must justify your answer.
A 3 way (ternary) min heap is a 3 way ( ternary – each node as atmost three children nodes, left, mid, right ) complete tree with min heap property ( value of the paren...
Shaik Masthan
758
views
Shaik Masthan
asked
Aug 27, 2019
Programming in C
iiit-blr
data-structures
binary-heap
descriptive
+
–
0
votes
0
answers
2388
Stack
Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Push and Pop operation take X seconds each, and Y seconds elapse between the end of one such stack operation and the start ... The average stack-life of an element of this stack is A n(X+ Y) B 3Y + 2X C n(X + Y)-X D Y + 2X
Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform n pop operations. Assume that Pu...
Ananya Jain 1
758
views
Ananya Jain 1
asked
Jun 11, 2017
0
votes
2
answers
2389
Made Easy Subject Test 2019: Programming & DS
void PrintValue(int n) { if (n < 0) return; else { printf(n); printValue(--n); printValue(n--); printf(n); } } Output for Print(5) ?
void PrintValue(int n) { if (n < 0) return; else { printf(n); printValue( n); printValue(n ); printf(n); } }Output for Print(5) ?
Na462
757
views
Na462
asked
Jan 16, 2019
Programming in C
programming
programming-in-c
made-easy-test-series
+
–
0
votes
0
answers
2390
Self Doubt
Leaf Nodes =[ Internal nodes with degree 2 ] + 1 It is valid if we consider Tree as undirected graph ? Or is it valid only for Tree when considered as directed graph
Leaf Nodes =[ Internal nodes with degree 2 ] + 1It is valid if we consider Tree as undirected graph ?Or is it valid only for Tree when considered as directed graph
jatin khachane 1
757
views
jatin khachane 1
asked
Dec 29, 2018
DS
programming-in-c
tree
+
–
Page:
« prev
1
...
114
115
116
117
118
119
120
121
122
123
124
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register