Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions and answers in Programming and DS
9.3k
views
5
answers
15
votes
GATE CSE 2021 Set 2 | Question: 2
Let $H$ be a binary min-heap consisting of $n$ elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in ... \Theta (1)$\Theta (\log n)$\Theta (n)$\Theta (n \log n)$
Cxdr
9.3k
views
Cxdr
answered
5 hours
ago
DS
gatecse-2021-set2
data-structures
binary-heap
time-complexity
1-mark
+
–
164
views
1
answers
0
votes
self doubt
let suppose address of first index of array is n and size of each block of array is u. then the index of second element is a+u.let suppose the array has m elements. ... array of same size, if it's address of second last element is (n - u).
nothingToDo
164
views
nothingToDo
answered
7 hours
ago
Programming in C
programming-in-c
array
+
–
91
views
2
answers
1
votes
pointers in c programming answer the output
#include <stdio.h> int main() { // Write C code here int i=10,*p,**q,***r; p=&i; *p=15; q=&p; **q=20; r=&q; ***r=*p+1; printf("%d",i); return 0; }answer the output as integer _________
nothingToDo
91
views
nothingToDo
answered
1 day
ago
Programming in C
programming-in-c
programming
pointers
numerical-answers
+
–
3.1k
views
3
answers
7
votes
GATE CSE 2024 | Set 2 | Question: 23
Consider the following $\mathrm{C}$ function definition.int f X(char * a) { char * b = a; while (*b) b ++; return b - a; }Which of the following ... in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
nothingToDo
3.1k
views
nothingToDo
answered
1 day
ago
Programming in C
gatecse2024-set2
programming
programming-in-c
multiple-selects
output
+
–
5.0k
views
3
answers
8
votes
GATE CSE 2024 | Set 2 | Question: 3
Consider the following $\text{C}$ program. Assume parameters to a function are evaluated from right to left.#include <stdio.h> int g( int p) { printf( ... $ program?$20101020$10202010$20102010$10201020$
nothingToDo
5.0k
views
nothingToDo
answered
1 day
ago
Programming in C
gatecse2024-set2
programming
programming-in-c
functions
+
–
53
views
1
answers
0
votes
Recursion
Find Output of below Code#include<stdio.h>int sum(int n) { n = 3; if (n == 2) return 2; return sum(n-1)*n ;}int main() { printf("%d\n", sum(5) ); return 0}
Bhaskar_Saini
53
views
Bhaskar_Saini
answered
2 days
ago
Programming in C
programming-in-c
programming
recursion
output
2-marks
+
–
63
views
1
answers
1
votes
Answer the following C programming code
#include <stdio.h> void f(int (*x)(int)); int myfoo(int i); int (*foo)(int) = myfoo; int main() { f(foo(10)); } void f( ... i; }sanfoundry C programming Questiona) Compile time errorb) Undefined behaviourc) 10 11d) 10 Segmentation fault
shivamSK
63
views
shivamSK
answered
5 days
ago
Programming in C
programming-in-c
programming
gateoverflow
+
–
97
views
1
answers
1
votes
c programming
#include <stdio.h> int main() { int (*a)[2]; int arr[4][4]={1,2,3,4,6,7,8,9}; a=arr; ++a; printf("%d",**a); return 0; }what is the answer NUMARICAL--------------------------------?
shivamSK
97
views
shivamSK
answered
5 days
ago
Programming in C
programming
programming-in-c
array
array-of-pointers
+
–
57
views
0
answers
1
votes
give output of following c code
#include <stdio.h> void f(int (*x)(int)); int mysh(int); int (*sh)() = mysh; int main() { f(sh); sh++; for(int x=sh;x>=0;x--){ if(x){ printf ... A:10C:10 i will go thereB:10 i will go there number of timesD:10 i will go here number of times
shivamSK
57
views
shivamSK
asked
6 days
ago
Programming in C
programming-in-c
programming
1-mark
2-marks
recursion
array-of-pointers
array
+
–
40
views
0
answers
0
votes
#genral doubt
Not related to gate but genral programming..if some one ask me array indexing start from 0,yes i know array indexing start from 0 . but can i also say ... Array indexing tell me how many steps ahed are from the first position of array,
jugnu1337
40
views
jugnu1337
asked
6 days
ago
Programming in C
interview
general-topic-doubt
+
–
72
views
2
answers
1
votes
DAIICT-gandhinagar MSC-IT c-programming Question
shivamSK
72
views
shivamSK
answered
6 days
ago
Programming in C
programming-in-c
programming
mtech
interview
+
–
122
views
1
answers
1
votes
C programming Array & Loops
#include <stdio.h> int main () { int i, k; int a [8] = {33,34,35,36,37,40,50,38}; for(i = 0; i < 3; i++) { a[i] = a[i] + 1; i=i+1; } ... int i = k/2; a[i] = a[i] - 1; } printf ("%d",i+a[i]); }Numerical Answer ______________________________
ZinxKaltz
122
views
ZinxKaltz
answered
Jun 17
Programming in C
programming-in-c
programming
array
loop
loop-invariants
+
–
149
views
1
answers
1
votes
Gate 2007 pyq C programming
what is output of c code : assume answer Is numerical...🙂
simi2426
149
views
simi2426
answered
Jun 12
Programming in C
goclasses
programming-in-c
2-marks
programming
+
–
83
views
1
answers
1
votes
what is the output of following c code 1/2 marks
what is output of this c codeA: 321B: 123C: error(infinite/segmentation)D:333
Bhaskar_Saini
83
views
Bhaskar_Saini
answered
Jun 12
Programming in C
goclasses
1-mark
programming-in-c
programming
2-marks
+
–
17.9k
views
6
answers
64
votes
GATE CSE 2014 Set 1 | Question: 10
Consider the following program in C language:#include <stdio.h> main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Which one of ... of variable $i$.On execution, the value printed is $5$ more than the integer value entered.
ybairwa786
17.9k
views
ybairwa786
answered
Jun 12
Programming in C
gatecse-2014-set1
programming
programming-in-c
easy
pointers
+
–
26.9k
views
12
answers
57
votes
GATE IT 2006 | Question: 9
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree is$10$11$12$15$
PiyushJain
26.9k
views
PiyushJain
answered
Jun 11
DS
gateit-2006
data-structures
binary-tree
normal
+
–
375
views
2
answers
1
votes
Bitwise Operator - C Programming
Problem Statement: Class teacher to IX-C wants to store whether a particular student has passed in exams. The class has a strength of $32$ students. Their roll ... of set bitsd. Apply Bitwise AND (&) operator and count number of set bits
polaris_157
375
views
polaris_157
answered
Jun 10
Programming in C
programming-in-c
operator-precedence
boolean-algebra
+
–
104
views
1
answers
1
votes
what is the output of following c code A:2 B:32 C:16 D:NONE
#include <stdio.h> double pom(double x,int n){ if(n==1) return x; else return x*pom(x,n-1); --n; } int main() { int a=pom(2,5); printf("%d",a); return 0; }what is the output of following c codeA:2B:32C:16D:NONE
arpat27
104
views
arpat27
answered
Jun 10
Programming in C
programming-in-c
programming
goclasses
1-mark
+
–
40.1k
views
7
answers
129
votes
GATE CSE 2008 | Question: 46
You are given the postorder traversal, $P$, of a binary search tree on the $n$ elements $1, 2, \dots, n$. You have to determine the unique binary search ... n)$\Theta(n\log n)$None of the above, as the tree cannot be uniquely determined
ybairwa786
40.1k
views
ybairwa786
answered
Jun 10
DS
gatecse-2008
data-structures
binary-search-tree
normal
+
–
11.9k
views
5
answers
21
votes
GATE CSE 2023 | Question: 25
The integer value printed by the $\textsf{ANSI-C}$ program given below is _______________#include<stdio.h> int funcp(){ static int x = 1; x++; return x; } int main(){ int x,y; x = funcp(); y = funcp()+x; printf("%d\n", (x+y)); return 0; }
shivamSK
11.9k
views
shivamSK
answered
Jun 9
Programming in C
gatecse-2023
programming
programming-in-c
output
numerical-answers
1-mark
+
–
120
views
2
answers
1
votes
programming in c, conditional statement using if else and increment decrement operator
answer the output#include <stdio.h> int main() { int x=0; x++; if(--x){ x=x++; if(x){ printf("hello"); }else{ printf("%d",x); } }else{ x=x+5; if(x){ printf("i win x times"); } else{ printf("you win 5 times"); } } return 0; }
ZinxKaltz
120
views
ZinxKaltz
answered
Jun 9
Programming in C
programming-in-c
programming
+
–
702
views
3
answers
7
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 13
What will be the output of following program ?#include <stdio.h> int thefunction(int a) { static int b = 0; b++; a = a + b; return a; } int main() { int b = 0; int i; ... 3; i++) { b = b + thefunction(i); } printf("%d\n", b); return 0; }
shivamSK
702
views
shivamSK
answered
Jun 8
Programming in C
goclasses2024-mockgate-12
goclasses
numerical-answers
programming
programming-in-c
storage-classes-in-c
1-mark
+
–
5.1k
views
4
answers
20
votes
GATE CSE 1987 | Question: 2g
State whether the following statements are TRUE or FALSE:If the number of leaves in a tree is not a power of $2,$ then the tree is not a binary tree.
ybairwa786
5.1k
views
ybairwa786
answered
Jun 6
DS
gate1987
data-structures
binary-tree
true-false
+
–
29.0k
views
12
answers
77
votes
GATE CSE 1994 | Question: 1.11
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero elements, (i.e elements of ... $i+\frac{j(j-1)}{2}$
suraj_soni
29.0k
views
suraj_soni
answered
May 20
DS
gate1994
data-structures
array
normal
+
–
5.3k
views
3
answers
27
votes
GATE CSE 1993 | Question: 12
The following Pascal program segments finds the largest number in a two-dimensional integer array $A[0\dots n-1, 0\dots n-1]$ using a single loop. Fill up the boxes to complete the ... |C| then j:=j+1; else begin j:=0; i:=|D| end end end
Debargha5943
5.3k
views
Debargha5943
answered
May 15
DS
gate1993
data-structures
array
normal
descriptive
+
–
287
views
1
answers
2
votes
Gate Wallah DPP
Consider the following function:int arc(int i, int j){if(i<2) return j+2;else if(j<2) return arc(i-1, 1);else return arc(i-1, arc(i, j-2));}The value returned by arc(2, 6) is _________
Bhaskar_Saini
287
views
Bhaskar_Saini
answered
May 12
Programming in C
programming-in-c
numerical-answers
+
–
165
views
1
answers
0
votes
Functions
Consider the following function:int arc(int i, int j){if(i<2) return j+2;else if(j<2) return arc(i-1, 1);else return arc(i-1, arc(i, j-2));}The value returned by arc(2, 6) is ____________
Prakash_017
165
views
Prakash_017
answered
May 12
Programming in C
functions
+
–
306
views
1
answers
1
votes
Arrays
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element present at location arr[–6][4] is- ____________.
Nirmal7488
306
views
Nirmal7488
answered
May 8
DS
array
data-structures
+
–
4.0k
views
3
answers
6
votes
GATE CSE 2024 | Set 2 | Question: 26
What is the output of the following $\text{C}$ program?#include <stdio.h> int main() { double a[2]=20.0,25.0,* p,* q; p=a ; q=p+1 ; printf("%d,%d", (int) (q-p),( int)(* q- * p)); return 0;$4,8$1,5$8,5$1,8$
Cxdr
4.0k
views
Cxdr
answered
May 7
Programming in C
gatecse2024-set2
programming
programming-in-c
pointers
+
–
9.9k
views
5
answers
21
votes
GATE CSE 2022 | Question: 5
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,the reversed linked list should look likeWhich one of the following ... is not possible to reverse a singly linked list in $O(1)$ space.
yudhistar
9.9k
views
yudhistar
answered
May 6
DS
gatecse-2022
data-structures
linked-list
1-mark
+
–
78
views
0
answers
0
votes
i am not able to give test
arjun1947
78
views
arjun1947
asked
May 5
146
views
0
answers
0
votes
university assignment question
The array-based stack throws an exception when the array's capacity has been reached. Consider the following alternative : create a larger array, using the resize method. The cost ... the resize, elements maySolutions = O(N^2)O(N)O(N^2)O(N)
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
146
views
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
asked
May 5
DS
data-structures
array
time-complexity
+
–
17.9k
views
5
answers
67
votes
GATE CSE 2006 | Question: 13
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X[1]$. For a node stored at ... $ should be$\log_2 n$n$2n+1$2^n-1$
snehasish
17.9k
views
snehasish
answered
May 3
DS
gatecse-2006
data-structures
binary-tree
normal
+
–
1.5k
views
1
answers
0
votes
UGC NET CSE | June 2010 | Part 2 | Question: 33
Consider the following left associative operators in decreasing order of precedence :- subtraction (highest precedence)* multiplication ... 4 $ | * 2** 3$-61$64$ $512$ $4096$
Vivek kadam
1.5k
views
Vivek kadam
answered
May 1
Programming in C
ugcnetcse-june2010-paper2
programming
operator-precedence
+
–
312
views
1
answers
1
votes
GO Classes 2024 | IIITH Mock Test 5 | Question: 46
In which of the following case(s) character array must end with null char?char c[] = "GATE";char c[] = {'2', '0', '2', '3'};char c[4] = "GATE";char c[16] = "2023";
anishsp
312
views
anishsp
answered
May 1
Programming in C
goclasses2024-iiith-mock-5
goclasses
programming
programming-in-c
array
multiple-selects
1-mark
+
–
261
views
1
answers
0
votes
C Programming - Arrays & Pointer (NAT)
#include <stdio.h> int main() { int a[3][2] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; }(Assume size of int to be $2$ bytes.)The output is __________.
kumaruk
261
views
kumaruk
answered
May 1
Programming in C
array
data-structures
programming-in-c
+
–
299
views
2
answers
2
votes
GO Classes 2024 | IIITH Mock Test 5 | Question: 16
What will be printed by following $\text{C}$ code?int a[7] = {0, 1, 2, 3, 4, 5, 6}; int *p = &a[3]; p += 2; *p += 2; printf("%d", *p++);$6$7$8$9$
naval
299
views
naval
answered
Apr 30
Programming in C
goclasses2024-iiith-mock-5
goclasses
programming
programming-in-c
pointers
1-mark
+
–
320
views
2
answers
1
votes
Test series question of ace academy
#include<stdio.h>#define ADD(a,b)(a+b)#define SQUARE(x)(x*x)int main(){int x=2;int y=3;int z = ADD(SQUARE(x++),y);printf("%d\n",z);return 0;}What is the output of the above code snippet?
Abha Gupta
320
views
Abha Gupta
answered
Apr 29
Programming in C
ace-test-series
+
–
1.1k
views
1
answers
3
votes
GO Classes 2023 | IIITH Mock Test 1 | Question: 14
Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. ... $S1$ is incorrect but $S2$ is correctBoth are correctBoth are incorrect
Poojan Sheth
1.1k
views
Poojan Sheth
answered
Apr 26
DS
goclasses2023-iiith-mock-1
goclasses
data-structures
tree
binary-tree
1-mark
+
–
647
views
2
answers
1
votes
DRDO CSE 2022 Paper 1 | Question: 29
Five items $\text{A, B, C, D, E}$ are pushed onto a stack, one after other starting from item $\mathrm{A}$. The stack is then popped by three items, and ... . Now, one item is popped from the stack. Which item is at the top of the stack.
soumya24
647
views
soumya24
answered
Apr 22
DS
drdocse-2022-paper1
data-structures
stack
5-marks
descriptive
+
–
To see more, click for all the
questions in this category
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register