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
0
answers
221
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
597
views
Jeetmoni saikia
asked
Oct 10, 2022
Programming in C
programming
object-oriented-programming
+
–
1
votes
0
answers
222
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
413
views
Chaitanya Kale
asked
Oct 9, 2022
Programming in C
avl-tree
data-structures
time-complexity
+
–
1
votes
1
answer
223
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
380
views
rsansiya111
asked
Oct 7, 2022
Programming in C
java
object-oriented-programming
+
–
0
votes
1
answer
224
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
332
views
SHWETAV SUMAN
asked
Oct 6, 2022
Programming in C
programming-in-c
+
–
0
votes
0
answers
225
Data Structure
Not able to understand the last option.
Not able to understand the last option.
Overflow04
304
views
Overflow04
asked
Oct 2, 2022
DS
data-structures
binary-search-tree
made-easy-test-series
+
–
0
votes
1
answer
226
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
362
views
Overflow04
asked
Oct 2, 2022
DS
made-easy-test-series
binary-search-tree
+
–
0
votes
0
answers
227
postfix expression
I want to know which evaluation is wrong here: a-b-c = ab-c- or a-b-c = abc- – a * b *c = ab*c* a*b*c = abc** 3 . a+b-c = ab+c- a+b-c = abc-+
I want to know which evaluation is wrong here:a-b-c = ab-c- or a-b-c = abc- –a * b *c = ab*c* a*b*c = abc 3 . a+b-c = ab+c- a+b-c = ...
Overflow04
459
views
Overflow04
asked
Oct 2, 2022
Programming in C
self-doubt
infix-prefix
programming-in-c
+
–
0
votes
2
answers
228
Programming and DS
#include <stdio.h> int main(){ int a[] = {5,3,7,2,4}; int *p = &a[3]; p -= *p; printf("%d ",*p); return 0; } output is 3. Why 2 * sizeof(int) is doene.?
#include <stdio.h int main(){ int a[] = {5,3,7,2,4}; int *p = &a[3]; p -= *p; printf("%d ",*p); return 0; } output is 3.Why 2 * sizeof(int) is doene.?
Overflow04
352
views
Overflow04
asked
Oct 2, 2022
Programming in C
programming-in-c
made-easy-test-series
+
–
0
votes
1
answer
229
Data Structure
Can we determine unique tree by Inorder and level order traversal .
Can we determine unique tree by Inorder and level order traversal .
Overflow04
453
views
Overflow04
asked
Sep 28, 2022
Programming in C
data-structures
binary-tree
self-doubt
+
–
0
votes
0
answers
230
unacademy test series
Consider a string is stored in a word addressable memory where each word is of 4 Bytes. If the string starts at 100 and ends at 104 then which of the following can be the possible string(s) that can be stored. A)STRUCTURE B)UNION C)POINTER D)FUNCTION
Consider a string is stored in a word addressable memory where each word is of 4 Bytes. If the string starts at 100 and ends at 104 then which of the following can be the...
Pranavpurkar
599
views
Pranavpurkar
asked
Sep 27, 2022
Programming in C
programming-in-c
strings
unacademy-test-series
+
–
1
votes
1
answer
231
DOUBT
DOUBT: suppose a memory space of 16B is given and it is asked that what is the maximum length of string it can store. then do we have to consider the space taken by the “\0” also? OR just the string length?
DOUBT:suppose a memory space of 16B is given and it is asked that what is the maximum length of string it can store.then do we have to consider the space taken by the �...
Pranavpurkar
364
views
Pranavpurkar
asked
Sep 27, 2022
Programming in C
programming
strings
+
–
0
votes
0
answers
232
Doubt
DOUBT 1: if head = P → link. is performed then what will happen to the nodes containing values a and b? will they get removed as no link is pointing them? and we will left with only three nodes like DOUBT 2: what does head = (*P).link; equals to?
DOUBT 1: if head = P → link.is performed then what will happen to the nodes containing values a and b? will they get removed as no link is pointing them?and we will ...
Pranavpurkar
595
views
Pranavpurkar
asked
Sep 27, 2022
Programming in C
data-structures
linked-list
doubt
+
–
0
votes
0
answers
233
Unacademy test series
Which of the following is/are true regarding the following code snippet? 1:int *p; 2:p = &q; A)*p gives faster retrieval of information than q. B)The size of p is same as size of int. C)Only statement 2 gives an error. D)In statement 1, * is used as a dereferencing operator.
Which of the following is/are true regarding the following code snippet?1:int *p;2:p = &q; A)*p gives faster retrieval of information than q.B)The size of p is same as si...
Pranavpurkar
551
views
Pranavpurkar
asked
Sep 27, 2022
Programming in C
programming-in-c
pointers
unacademy-test-series
bad-question
+
–
0
votes
2
answers
234
made easy gate cs question bank
What will be the output printed for find(4)? void find(int x) { static int i = 10, y = 0; y = y + i; for(i; i>0; i = i - 10) { if(x! = 0) find(x – 1); else printf(“%d”, y); } }
What will be the output printed for find(4)? void find(int x) { static int i = 10, y = 0; y = y + i; for(i; i>0; i = i - 10) { if(x! = 0) find(x – 1); else printf(“%d...
rohitkaushal1
502
views
rohitkaushal1
asked
Sep 22, 2022
Programming in C
algorithms
programming-in-c
loop
+
–
0
votes
2
answers
235
data structure using c, by yaswant kanethkar
Explain the method to calculate the address of an element in an array. A 25*4 matrix array DATA is stored in memory in ‘row-major order’. If base address is 200 and 4 words per memory cell. Calculate the address of DATA [12, 3]…??
Explain the method to calculate the address of an element in an array. A 25*4 matrix arrayDATA is stored in memory in ‘row-major order’. If base address is 200 and 4 ...
akama
1.2k
views
akama
asked
Sep 11, 2022
DS
data-structures
array
matrix
+
–
0
votes
1
answer
236
Data structures and algorithms
Assume Two-Dimensional Sorted Array (TDSA) is a two-dimensional matrix of size n × n such as the elements in the matrix are sorted row-wise and column-wise. For example, the following matrix is a TDSA. 1 2 3 4 5 6 7 8 9 Write an algorithm that should convert the given matrix of a dimension n × n into TDSA. Analyse the running time of the algorithm.
Assume Two-Dimensional Sorted Array (TDSA) is a two-dimensionalmatrix of size n × n such as the elements in the matrix are sortedrow-wise and column-wise. For example, t...
Karthi2003
438
views
Karthi2003
asked
Sep 9, 2022
DS
algorithms
sorting
time-complexity
+
–
0
votes
0
answers
237
Data structures and algorithms
Compute the running time for the following algorithm ALGORITHM RKU(a,k,n) //Input: a is an array of n element and k is a value { if( k == n) then { WRITE(a[1:n]); return 0; } else { for i ← k to n do { t ← a[k]; a[k] ← a[i]; a[i] ← t; RKU(a, k+1, n); t ← a[k]; a[k] ← a[i]; a[i] ← t; } }
Compute the running time for the following algorithmALGORITHM RKU(a,k,n)//Input: a is an array of n element and k is a value{if( k == n) then{WRITE(a[1:n]);return 0;}else...
Karthi2003
355
views
Karthi2003
asked
Sep 9, 2022
DS
algorithms
time-complexity
+
–
0
votes
1
answer
238
Algorithms
Given ‘N’ objects, which are coloured as red, white and blue. Sort these objects so that objects of the same colour are adjacent, with the colours in the order red, white and blue. Design an algorithm with a time com- plexity of O(nlog n)
Given ‘N’ objects, which are coloured as red, white and blue. Sort theseobjects so that objects of the same colour are adjacent, with the coloursin the order red, whi...
Karthi2003
670
views
Karthi2003
asked
Sep 9, 2022
DS
algorithms
sorting
time-complexity
+
–
3
votes
1
answer
239
TIFR CSE 2022 | Part B | Question: 1
Which data structure is commonly used to implement breadth first search in a graph? A queue A stack A heap A hash table A splay tree
Which data structure is commonly used to implement breadth first search in a graph?A queueA stackA heapA hash tableA splay tree
admin
549
views
admin
asked
Sep 1, 2022
DS
tifr2022
data-structures
queue
easy
+
–
2
votes
1
answer
240
TIFR CSE 2022 | Part B | Question: 5
There is an unsorted list of $n$ integers. You are given $3$ distinct integers and you have to check if all $3$ integers are present in the list or not. The only operation that you are allowed to perform is a comparison. Let $A$ be an algorithm for this task that performs the least number ... $c=3 n$ $c=2 n+5$ $c \geq 3 n-1$ $c \leq n$ $c \leq 2 n+3 $
There is an unsorted list of $n$ integers. You are given $3$ distinct integers and you have to check if all $3$ integers are present in the list or not. The only operatio...
admin
614
views
admin
asked
Sep 1, 2022
DS
tifr2022
data-structures
linked-list
+
–
Page:
« prev
1
...
7
8
9
10
11
12
13
14
15
16
17
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register