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
1
votes
2
answers
201
Malloc | Free | Dangling Pointer | Prog. & DS
MSQ Consider the following C snippet: #include <stdio.h> int main() { int *ptr = (int*) malloc(100*sizeof(int)); *ptr=33; printf("%d %d\n",ptr,*ptr); // Line X free(ptr); *ptr=37; printf("%d %d\n",ptr,* ... *ptr) is 0 as in Line Y, the allocated heap is freed, and we cannot update it anymore, as ptr is now a dangling pointer
MSQ Consider the following C snippet:#include <stdio.h int main() { int *ptr = (int*) malloc(100*sizeof(int)); *ptr=33; printf("%d %d\n",ptr,*ptr); // Line X free(ptr); *...
Souvik33
608
views
Souvik33
asked
Nov 28, 2022
Programming in C
data-structures
pointers
programming-in-c
+
–
0
votes
0
answers
202
Consider the following function cosmo(): int cosmo(int n) { for (i = 1; i <= n; i++) { for(i= 1; i <= 1; 1₂++) { for(i=1; i <= 1; iz ++) { **** ( for(i=1;i<= ₁; i++) { } count++; Initially, the value of the variable count is zero. Also assume the variables are declared before use. Then the value returned by the function call cosmo(8) when the value of m is equal to 6, will be
damz1499
310
views
damz1499
asked
Nov 11, 2022
Programming in C
programming-in-c
+
–
0
votes
1
answer
203
Data structures and algorithms
Consider the last four digits of your register number and form the following numbers: 1. first digit 2. second digit 3. third digit 4. fourth digit 5. 2 digit number with the first two digits 6. 2 digit number with the last two digits ... inserted into a hash table whose description is given above and the contents of the table after insertion are to be clearly given.
Consider the last four digits of your register number and form the following numbers:1. first digit2. second digit3. third digit4. fourth digit5. 2 digit number with the ...
Karthi2003
484
views
Karthi2003
asked
Nov 7, 2022
DS
data-structures
hashing
linear-probing
+
–
0
votes
3
answers
204
Stacks
The maximum size of the operator stack when converting the following infix to postfix expression a ^ b * c * d + e * f ^ g (assume that “^” has highest precedence and right associativity) and also output the postfix expression.
The maximum size of the operator stack when converting the following infix to postfix expressiona ^ b * c * d + e * f ^ g (assume that “^” has highest precedence and ...
vivek1211
706
views
vivek1211
asked
Nov 6, 2022
Programming in C
data-structures
stack
infix-prefix
+
–
0
votes
1
answer
205
Ace Test Series Data Structure Q9
Which data structure would be most appropriate to implement a collection of values with the following 3 characteristics Singly link list with head and tail pointer Doubly link list with only head pointer Binary tree Array
Which data structure would be most appropriate to implement a collection of values with the following 3 characteristicsSingly link list with head and tail pointerDoubly l...
Souvik33
840
views
Souvik33
asked
Nov 2, 2022
DS
data-structures
linked-list
test-series
stack
queue
+
–
2
votes
0
answers
206
igate test series
AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1 if n is the number of nodes in a AVL tree . The maximum value of n for which the difference between the minimum height and maximum height of AVL tree is <2 _________ ?
AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1 if n is the ...
jugnu1337
479
views
jugnu1337
asked
Nov 1, 2022
DS
i-gate-test-series
programming
binary-search-tree
avl-tree
+
–
1
votes
0
answers
207
Ace Academy Test Series Qn#7
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same hash value? 3 4 10 64
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same h...
Souvik33
394
views
Souvik33
asked
Oct 30, 2022
DS
ace-test-series
data-structures
hashing
pigeonhole-principle
discrete-mathematics
+
–
0
votes
0
answers
208
Ace Academy Test Series
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same hash value? 3 4 10 64
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same h...
Souvik33
317
views
Souvik33
asked
Oct 30, 2022
DS
ace-test-series
data-structures
hashing
pigeonhole-principle
discrete-mathematics
+
–
0
votes
1
answer
209
Self-Doubt: Stack Overflow in LinkedList
Can there be “Stack Overflow” in Linked list Implementation of stack? If Yes, how?
Can there be “Stack Overflow” in Linked list Implementation of stack? If Yes, how?
Abhrajyoti00
719
views
Abhrajyoti00
asked
Oct 29, 2022
DS
stack
data-structures
linked-list
+
–
–4
votes
2
answers
210
Data Structure- Tree & Graphs
*MSQ* The following figure depicts a a. A tree and only tree b. A tree with 3 nodes c. A graph (Since every tree is a graph) d. A graph and only graph
*MSQ*The following figure depicts a a. A tree and only treeb. A tree with 3 nodesc. A graph (Since every tree is a graph)d. A graph and only graph
Souvik33
608
views
Souvik33
asked
Oct 27, 2022
Programming in C
data-structures
tree
graph-theory
multiple-selects
normal
bad-question
+
–
0
votes
0
answers
211
Class P { void f(int i) { print(i); } } Class Q subclass of P { void f(int i) { print(2*i); } } Now consider the following program fragment: P x = new Q(); Q y = new Q(); P z = new Q(); x.f(1); ((P)y).f(1); z.f(1); Here ((P)y) denotes a typecast of y to P. The output produced by executing the above program fragment will be (A) 1 2 1 (B) 2 1 1 (C) 2 1 2 (D) 2 2 2
Jeetmoni saikia
284
views
Jeetmoni saikia
asked
Oct 16, 2022
Programming in C
programming-in-c
output
normal
+
–
0
votes
0
answers
212
made easy test series
Neelu Lalchandani
336
views
Neelu Lalchandani
asked
Oct 16, 2022
Programming in C
made-easy-test-series
programming-in-c
functions
+
–
1
votes
2
answers
213
Ace test series 2023
The return value of ace(4) is int ace(int a) { int x=1; static int k=1; if(a==1) return x; for(;k<a;++k) x=x+ace(k)*ace(a-k); return x; } A.15 B.4 C.10 D.Error
The return value of ace(4) is int ace(int a) { int x=1; static int k=1; if(a==1) return x; for(;k<a;++k) x=x+ace(k)*ace(a-k); return x; }A.15B.4C.10D.Error
Sazia Tabassum
576
views
Sazia Tabassum
asked
Oct 14, 2022
Programming in C
ace-test-series
programming-in-c
array
+
–
0
votes
1
answer
214
yashwant kanetkar chapter 5 A(F) 18th edition
i dont know why the answer is not coming for the following snippet. I COULD NOT UNDERSTAND EXPLAINATION IN YASHWANT KANETKAR BOOK int main() { float x=1.1; while(x==1.1) { printf(“%f\n”,x); x=x-0.1; } return0; }
i dont know why the answer is not coming for the following snippet. I COULD NOT UNDERSTAND EXPLAINATION IN YASHWANT KANETKAR BOOKint main(){float x=1.1;while(x==1.1){prin...
SHWETAV SUMAN
220
views
SHWETAV SUMAN
asked
Oct 14, 2022
Programming in C
programming-in-c
output
reference-book
+
–
0
votes
0
answers
215
Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed to be either Java or C++, though the syntax is similar. Class P { void f(int i) { print(i); } } Class Q subclass of P { void f(int i) { print(2*i); } } Now consider the following program fragment: P x = new Q(); Q y = new Q(); P z = new Q(); x.f(1); ((P)y).f(1); z.f(1); Here ((P)y) denotes a typecast of y to P. The output produced by executing the above program fragment will be (A) 1 2 1 (B) 2 1 1 (C) 2 1 2 (D) 2 2 2
Jeetmoni saikia
564
views
Jeetmoni saikia
asked
Oct 10, 2022
Programming in C
programming
object-oriented-programming
+
–
1
votes
0
answers
216
AVL Trees
Given a skew tree what will be the time complexity to balance the tree? What will be the algorithm for this?
Given a skew tree what will be the time complexity to balance the tree? What will be the algorithm for this?
Chaitanya Kale
393
views
Chaitanya Kale
asked
Oct 9, 2022
Programming in C
avl-tree
data-structures
time-complexity
+
–
1
votes
1
answer
217
Programming Question
An object whose contents cannot be changed once the object is created is called: (a) Immutable object (b) Mutable object (c) Smart object (d) Rich object
An object whose contents cannot be changed once the object is created is called:(a) Immutable object(b) Mutable object(c) Smart object(d) Rich object
rsansiya111
354
views
rsansiya111
asked
Oct 7, 2022
Programming in C
java
object-oriented-programming
+
–
0
votes
1
answer
218
this similar question was discussed in GO classes C programming video lectures by (sachin mittal sir.)
i have typed the following code but when i executed it the solution was not according to my expectation.unsigned short int y= -9; int iy=y; printf(“%d”,iy); solutio...
SHWETAV SUMAN
323
views
SHWETAV SUMAN
asked
Oct 6, 2022
Programming in C
programming-in-c
+
–
0
votes
0
answers
219
Data Structure
Not able to understand the last option.
Not able to understand the last option.
Overflow04
297
views
Overflow04
asked
Oct 2, 2022
DS
data-structures
binary-search-tree
made-easy-test-series
+
–
0
votes
1
answer
220
Programming
I am getting 5 as output, but the answer is 4, please verify
I am getting 5 as output, but the answer is 4, please verify
Overflow04
355
views
Overflow04
asked
Oct 2, 2022
DS
made-easy-test-series
binary-search-tree
+
–
Page:
« prev
1
...
6
7
8
9
10
11
12
13
14
15
16
...
309
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register