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
1
i am not able to give test
arjun1947
14
views
arjun1947
asked
1 day
ago
0
votes
0
answers
2
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 of a resize that makes the array larger is proportional to the new size. 1. Suppose we ... and 2 for queues.Note that after the resize, elements may Solutions = O(N^2) O(N) O(N^2) O(N)
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 metho...
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
34
views
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
asked
1 day
ago
1
votes
2
answers
3
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?
#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 abo...
Ayush_Pal
144
views
Ayush_Pal
asked
Apr 26
Programming in C
ace-test-series
+
–
1
votes
0
answers
4
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- ____________.
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 pres...
piyush512
127
views
piyush512
asked
Apr 20
DS
array
data-structures
+
–
0
votes
2
answers
5
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 __________.
#include <stdio.h int main() { int a[3] = {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.)T...
Debargha Mitra Roy
135
views
Debargha Mitra Roy
asked
Apr 16
Programming in C
array
data-structures
programming-in-c
+
–
0
votes
0
answers
6
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 numbers lie in the range: $[1, 32]$. The teacher used bits of an integer to store ... Bitwise OR (|) operator and count number of set bits d. Apply Bitwise AND (&) operator and count number of set bits
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 numbers li...
Debargha Mitra Roy
180
views
Debargha Mitra Roy
asked
Apr 12
Programming in C
programming-in-c
operator-precedence
boolean-algebra
+
–
1
votes
1
answer
7
Consider the following program: #include <stdio.h> int main(){ int a=2, i; static int b=a++; for(i=0;i<a+b;i++) printf("GATE Wallah"); return 0; } Which of the following is/are CORRECT? (a) GATE Wallah is printed 3 times. (b) GATE Wallah is printed 4 times. (c) GATE Wallah is printed 5 times. (d) Compilation Error.
Consider the following program: #include <stdio.h int main(){ int a=2, i; static int b=a++; for(i=0;i<a+b;i++) printf("GATE Wallah"); return 0; }Which of the following is...
Pradeep kori 73
90
views
Pradeep kori 73
asked
Apr 11
0
votes
2
answers
8
C Programming - Recursion
What is the output of the below code? #include <stdio.h> void main() { static int var = 5; printf("%d ", var--); if (var) main(); } a. 1 2 3 4 5 b. 1 c. 5 4 3 2 1 d. Error
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
Debargha Mitra Roy
151
views
Debargha Mitra Roy
asked
Apr 10
Programming in C
recursion
programming-in-c
programming
+
–
1
votes
1
answer
9
#Recursivefunctions
int bar(int val){ int x=0; while(val > 0){ x=x+bar(val -1); } return val; } Q: For bar(3) this function is supposed to be stuck in an infinite loop but I do not know how please can someone explain?
int bar(int val){int x=0;while(val 0){x=x+bar(val -1);}return val;}Q: For bar(3) this function is supposed to be stuck in an infinite loop but I do not know how please c...
sumitkumarsethi
107
views
sumitkumarsethi
asked
Apr 8
Programming in C
recursion
functions
+
–
3
votes
0
answers
10
GATE CSE SET-1 2024
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
RahulVerma3
166
views
RahulVerma3
asked
Mar 22
Programming in C
programming-in-c
programming
+
–
0
votes
0
answers
11
GATE 2024 CSE1
I have a question that can we use command line arguments without main function arguments? int main(int argc, char **argv){ }
I have a question that can we use command line arguments without main function arguments?int main(int argc, char argv){}
RahulVerma3
158
views
RahulVerma3
asked
Mar 16
Programming in C
programming-in-c
usergate2024
+
–
0
votes
1
answer
12
class question self doubt
#include<stdio.h> #include<conio.h> int main(){ int a[][3]={ {4,14,24},{5,15,25},{6,16,26}}; int *p[3]; int **ptr=p; p[0]=a; p[1]=a+1; p[2]=a+2; ++*p; ++p[0]; ++**ptr; ++*p[0]; ++ptr; ++*ptr; --*p[1]; --*ptr; ++ptr; --p[ ... ("\n%d,%d,%d",a[0][2],a[1][1],a[2][0]); printf("\n%d,%d,%d",*p[0],*p[1],*p[2]); } what is the output of above program
#include<stdio.h>#include<conio.h>int main(){ int a[][3]={ {4,14,24},{5,15,25},{6,16,26}}; int *p[3]; int ptr=p; p[0]=a; p =a+1; p =a+2; ++*p; ...
Emankashyap
199
views
Emankashyap
asked
Mar 1
2
votes
1
answer
13
c programming
#include <stdio.h> int main() { int i = -1; int x = (unsigned char)i; printf("%d", x); return 0; } output is 255 , but please explain how
#include <stdio.h int main() { int i = -1; int x = (unsigned char)i; printf("%d", x); return 0; }output is 255 , but please explain how
SSR17
283
views
SSR17
asked
Feb 29
Programming in C
programming-in-c
+
–
1
votes
0
answers
14
I have purchased the IIIT Hyderabad 2024 test series but i can't find the test series anywhere
Khushbu Chaudhary
109
views
Khushbu Chaudhary
asked
Feb 25
0
votes
1
answer
15
Linked List
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
Mrityudoot
195
views
Mrityudoot
asked
Feb 25
Programming in C
linked-list
data-structures
algorithms
+
–
0
votes
1
answer
16
s.balaguruswami
Find the error of the following IP addresses. If the IP is valid, check its Class and determine whether the address is Unicast or Multicast. i) 237.15.2.1 ii) 256.1.8.9 iii) 114.34.2.8 iv) 255.254.0.1 v) 8.8.8.8
Find the error of the following IP addresses. If the IP is valid, check its Class and determine whether the address is Unicast or Multicast.i) 237.15.2.1ii) 256.1.8.9iii)...
Sheikh Rafi
124
views
Sheikh Rafi
asked
Feb 24
0
votes
2
answers
17
GATE DS&AI 2024 | Question: 6
Match the items in Column $1$ with the items in Column $2$ in the following table: \begin{array}{|ll|ll|} \hline & \text{Column 1} & & \text{Column 2} \\ \hline \text{(p)} & \text{First In First Out} & \text{(i)} & \text{ ... $(\mathrm{p})-(\mathrm{i}),(\mathrm{q})-(\mathrm{iii}),(\mathrm{r})-(\mathrm{ii})$
Match the items in Column $1$ with the items in Column $2$ in the following table:\begin{array}{|ll|ll|}\hline & \text{Column 1} & & \text{Column 2} \\\...
Arjun
829
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
match-the-following
+
–
1
votes
1
answer
18
GATE DS&AI 2024 | Question: 11
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table with $m$ slots. The expected number of probes in an unsuccessful search is at most $\frac{1}{1-\alpha}$. Inserting ... $\frac{1}{1-\alpha}$ $1+\frac{\alpha}{2}$ $\frac{1}{1+\alpha}$
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table wi...
Arjun
861
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
hashing
uniform-hashing
+
–
0
votes
1
answer
19
GATE DS&AI 2024 | Question: 18
Consider the following tree traversals on a full binary tree: Preorder Inorder Postorder Which of the following traversal options is/are sufficient to uniquely reconstruct the full binary tree? $\text{(i) and (ii)}$ $\text{(ii) and (iii)}$ $\text{(i) and (iii)}$ $\text{(ii) only}$
Consider the following tree traversals on a full binary tree:PreorderInorderPostorderWhich of the following traversal options is/are sufficient to uniqu...
Arjun
1.1k
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
binary-tree
+
–
0
votes
1
answer
20
GATE DS&AI 2024 | Question: 22
The fundamental operations in a double-ended queue $D$ are: insertFirst (e) - Insert a new element $e$ at the beginning of $D$. insertLast (e) - Insert a new element $e$ at the end of D. removeFirst () - Remove and return the first element of $D$. removeLast () ... $\mathbf{a} \leftarrow$ removeLast () The value of $\mathbf{a}$ is $\_\_\_\_\_\_\_\_$.
The fundamental operations in a double-ended queue $D$ are: insertFirst (e) - Insert a new element $e$ at the beginning of $D$. insertLast (e) - Insert a new element $e$ ...
Arjun
761
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
numerical-answers
data-structures
+
–
Page:
1
2
3
4
5
6
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register