Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions and answers in Programming and DS
1
vote
2
answers
1
C: Test Your Aptitude
#include<stdio.h> void main() { char arr[]=”\0”; if(printf(“%s\n”,arr)) printf(“Nothing\n”); else printf(“Something\n”); } What is the output of the following code?
seba16
answered
in
Programming
3 days
ago
by
seba16
142
views
programming-in-c
0
votes
1
answer
2
physics wallah dpp #clanguage #pointer
anirudhkumar18
answered
in
Programming
Mar 18
by
anirudhkumar18
105
views
programming-in-c
pointers
physics-wallah
45
votes
9
answers
3
GATE CSE 2011 | Question: 29
We are given a set of $n$ distinct elements and an unlabeled binary tree with $n$ nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree? $0$ $1$ $n!$ $\frac{1} {n+1} .^{2n}C_n$
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
24.4k
views
gatecse-2011
binary-tree
normal
32
votes
10
answers
4
GATE CSE 2017 Set 1 | Question: 6
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are: Note: The height of a tree with a single node is $0$. $4$ and $15$ respectively. $3$ and $14$ respectively. $4$ and $14$ respectively. $3$ and $15$ respectively.
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
14.3k
views
gatecse-2017-set1
data-structures
binary-search-tree
easy
29
votes
2
answers
5
GATE IT 2008 | Question: 73
How many distinct BSTs can be constructed with $3$ distinct keys? $4$ $5$ $6$ $9$
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
10.4k
views
gateit-2008
data-structures
binary-search-tree
normal
0
votes
2
answers
6
made easy test series for gate cse 2023
please help me out in solving this question. the solution provided there is not upto the mark
Ujjaval251
answered
in
Programming
Mar 18
by
Ujjaval251
473
views
data-structures
heap-sort
heap
difficult
made-easy-test-series
24
votes
6
answers
7
GATE CSE 2004 | Question: 4, ISRO2009-26
The following numbers are inserted into an empty binary search tree in the given order: $10, 1, 3, 5, 15, 12, 16$. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)? $2$ $3$ $4$ $6$
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
19.5k
views
gatecse-2004
data-structures
binary-search-tree
easy
isro2009
24
votes
5
answers
8
GATE CSE 1996 | Question: 2.14
A binary search tree is generated by inserting in order the following integers: $50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24$ The number of nodes in the left subtree and right subtree of the root respectively is $(4, 7)$ $(7, 4)$ $(8, 3)$ $(3, 8)$
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
27.6k
views
gate1996
data-structures
binary-search-tree
normal
40
votes
8
answers
9
GATE CSE 2005 | Question: 2
An Abstract Data Type (ADT) is: same as an abstract class a data type that cannot be instantiated a data type for which only the operations defined on it can be used, but none else all of the above
Vasudevarnabmessi
answered
in
DS
Mar 18
by
Vasudevarnabmessi
16.7k
views
gatecse-2005
data-structures
normal
abstract-data-type
0
votes
1
answer
10
isro 2018
Consider the following C code segment: #include main() { int i, j , x ; scanf("%d", &x); i = 1 ; j = 1; while ( i< 10 ) { j = j * i; i = i + 1; if (i == x) break ; } } For the program fragment above, which of the following statements about the variables i and j must be true after ... = (x - 1)!) ∧ (i = x )) D (( j = 9!) ∧ (i = 10)) V (( j = (x - 1)!) ∧ (i = x ))
dsujay748
answered
in
Programming
Mar 16
by
dsujay748
897
views
programming-in-c
0
votes
1
answer
11
Practice question Avl trees
S1 : An insertion in an AVL with n nodes requires O(n) rotations. answer is false in answer key,but is guess for 1 insetion its O(1).so for n it will be O(n). tell me if i am wrong and correct me please.
Bharat Bhushan
answered
in
Programming
Mar 15
by
Bharat Bhushan
80
views
data-structures
avl-tree
0
votes
1
answer
12
binary search tree
Consider a binary search tree, while searching the key value 4, key values 1, 2, 3, 6, 8, 9, 10 and 11 are traversed not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing value 4?
Bharat Bhushan
answered
in
DS
Mar 5
by
Bharat Bhushan
119
views
data-structures
binary-search-tree
0
votes
1
answer
13
TOPIC - Infix to postfix and prefix conversion
Convert the following infix expression to postfix and prefix A^B^C^D
[ Jiren ]
answered
in
DS
Feb 25
by
[ Jiren ]
122
views
infix-prefix
2
votes
2
answers
14
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; }
sreya97
answered
in
Programming
Feb 22
by
sreya97
1.3k
views
gatecse-2023
programming
programming-in-c
output
numerical-answers
1-mark
5
votes
6
answers
15
ISRO2020-18
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The array is stored in row-major format. If the first element $x[0][0]$ occupies the memory location ... , which all locations (in decimal) will be holding a value of $10$? $1018,1019$ $1022,1041$ $1013,1014$ $1000,1399$
Haris_md
answered
in
Programming
Feb 19
by
Haris_md
6.8k
views
isro-2020
programming
array
normal
2
votes
1
answer
16
GATE CSE 2023 | Question: 3
Let $\textsf{SLLdel}$ be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let $\textsf{DLLdel}$ be another function that deletes a node in a doubly-linked list given a pointer to the node ... $\textsf{DLLdel}$ are $O(1)$ $\textsf{SLLdel}$ is $O(n)$ and $\textsf{DLLdel}$ is $O(1)$
DevUt
answered
in
DS
Feb 17
by
DevUt
1.8k
views
gatecse-2023
data-structures
linked-list
1-mark
2
votes
1
answer
17
GATE CSE 2023 | Question: 26
Consider the following program: int main() int f1() int f2(int X) int f3() { { { { f1(); return(1); f3(); return(5); f2(2); } if(X==1) } f3(); return f1(); return(0); else } return (X*f2(X-1)); } Which one of the following options represents the activation tree corresponding to the main function?
Hira Thakur
answered
in
Programming
Feb 16
by
Hira Thakur
1.1k
views
gatecse-2023
programming
programming-in-c
recursion
2-marks
3
votes
3
answers
18
GATE CSE 2023 | Question: 49
Consider a sequence $a$ of elements $a_{0}=1, a_{1}=5, a_{2}=7, a_{3}=8, a_{4}=9$, and $a_{5}=2$. The following operations are performed on a stack $S$ and a queue $Q,$ both of which are initially empty. $\textsf{push}$ the ... $S$. $\textsf{pop}$ an element from $S$. The top element of $S$ after executing the above operations is ______________.
Hira Thakur
answered
in
DS
Feb 16
by
Hira Thakur
915
views
gatecse-2023
data-structures
stack
numerical-answers
2-marks
2
votes
2
answers
19
GATE CSE 2023 | Question: 2
Which one of the following sequences when stored in an array at locations $A[1], \ldots, A[10]$ forms a max-heap? $23,17,10,6,13,14,1,5,7,12$ $23,17,14,7,13,10,1,5,6,12$ $23,17,14,6,13,10,1,5,7,15$ $23,14,17,1,10,13,16,12,7,5$
Hira Thakur
answered
in
DS
Feb 16
by
Hira Thakur
1.3k
views
gatecse-2023
data-structures
binary-heap
1-mark
2
votes
1
answer
20
GATE CSE 2023 | Question: 37
Consider the $\text{C}$ function $\text{foo}$ and the binary tree shown. typedef struct node { int val; struct node *left, *right; } node; int foo(node *p) { int retval; if (p == NULL) return 0; else { retval = p->val + foo(p->left) + foo(p->right); printf("%d ", ... $3 \;5\; 8\; 10\; 11\; 13$ $3 \;8 \;16 \;13\; 24\; 50$ $3\; 16\; 8\; 50\; 24\; 13$
Shaik Masthan
answered
in
DS
Feb 16
by
Shaik Masthan
908
views
gatecse-2023
data-structures
binary-tree
2-marks
1
vote
1
answer
21
GATE CSE 2023 | Question: 36
Let $A$ be a priority queue for maintaining a set of elements. Suppose $A$ is implemented using a max-heap data structure. The operation $\text{EXTRACT-MAX} (A)$ extracts and deletes the maximum element from $A$. The operation $\operatorname{INSERT}(A, key )$ inserts a new ... $O(1)$ whereas $\operatorname{INSERT}(A, k e y)$ runs in $O(\log (n))$.
akshaw
answered
in
DS
Feb 15
by
akshaw
983
views
gatecse-2023
data-structures
priority-queue
time-complexity
2-marks
40
votes
12
answers
22
GATE CSE 2015 Set 3 | Question: 25
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
Satyam258rt
answered
in
DS
Feb 13
by
Satyam258rt
17.9k
views
gatecse-2015-set3
data-structures
binary-tree
normal
numerical-answers
0
votes
1
answer
23
Made Easy test series
answer given is 33
mahendrapatel
answered
in
Programming
Feb 8
by
mahendrapatel
190
views
programming-in-c
output
made-easy-test-series
0
votes
1
answer
24
GATE CSE 2023 | Memory Based Question: 41
Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap? $23\; 17\; 10\; 6\; 13\; 14\; 1\; 5 \;9 \;12$ $23 \;14 \;19 \;1 \;10 \;13 \;16 \;12 \;7 \;5$ $23 \;17\; 14\; 6\; 13\; 10\; 1\; 5\; 7\; 15$ $23 \;17\; 14\; 7\; 13\; 10\; 1\; 5\; 6\; 12$
closed
Hira Thakur
answered
in
DS
Feb 6
by
Hira Thakur
468
views
memorybased-gatecse2023
goclasses
data-structures
binary-heap
0
votes
1
answer
25
ISRO CS 2018
#include <stdio.h> int main() { int i,j,x; scanf("%d ",x); i=1; j=1; while(i<10){ j=j*i; i=i+1; if(i==x) break; } return 0; }
striver23
answered
in
Programming
Feb 4
by
striver23
177
views
isro2018
programming-in-c
0
votes
1
answer
26
#madeeasy
is it ok to mark both and at least option in the case of MSQ, on my view in this question first option will always be true so marking the second is correct?
Pranavpurkar
answered
in
Programming
Feb 1
by
Pranavpurkar
117
views
programming-in-c
made-easy-test-series
query
0
votes
1
answer
27
TestBook testseries linkedList question
What does the following routine do on doubly linked list. M is some middle node address and N is a newly inserted node address. N → lptr = M ; N → rtptr = M → rptr ; N → lptr → rptr = N ; N → rptr → lptr = N ; Inserts a node to Right of M Left of M Right Most Left Most
Pranavpurkar
answered
in
DS
Jan 31
by
Pranavpurkar
87
views
data-structures
linked-list
0
votes
1
answer
28
#selfdoubt
how many topological sort possible for above graph?like this question https://gateoverflow.in/39669/gate-cse-2016-set-1-question-11
Pranavpurkar
answered
in
Programming
Jan 30
by
Pranavpurkar
82
views
programming
topological-sort
directed-acyclic-graph
0
votes
1
answer
29
Programming and Data Structure | Static int | Made Easy Test series (Modified)
Consider the following C code snippets, labeled as P1, P2 and P3, the output of P1 is X , of P2 is Y and of P3 as Z . What is the value of X+Y+Z P1 #include <stdio.h> int f(int n) { static int r=40; if (n==0 | ... 1,r)-r; } else return f(n-1,r)+(2*r); } int main() { printf("%d",f(6,40)); return 0; }
Souvik33
answered
in
Programming
Jan 29
by
Souvik33
155
views
data-structures
programming-in-c
0
votes
2
answers
30
back edge and no forward edge
Which does this sentence mean? In BFS of an undirected graph, there are no back edge and no forward edge.
supreetshukla
answered
in
DS
Jan 29
by
supreetshukla
2.0k
views
programming-in-c
data-structures
breadth-first-search
0
votes
1
answer
31
UPPCL AE 2018:65
Consider that $\text{N}$ distinct elements $(\text{N}>3)$ are inserted into an initially empty binary search tree $\text{(BST)}.$ Which of the following statements are true? None of the above The worst case height of the resulting $\text{BST}$ is ... $\text{BST}.$ Swapping the order of insertion of any two elements can always half the height of the resulting $\text{BST}.$
Sahil_Lather
answered
in
DS
Jan 28
by
Sahil_Lather
159
views
uppcl2018
data-structures
binary-search-tree
0
votes
0
answers
32
TestBook testSeries board game question
Consider a board game in consist of m n grid. A coin is located at the top-left corner of an m n grid. The coin can only move either down or right at any point in time. The ultimate goal of the game places the coin at the bottom-right corner of the grid. ... path(m-1, n) + path(m, n-1); } Find the number of unique paths if grid order is 5 4. 38 25 35 28
Sahil_Lather
asked
in
Programming
Jan 28
by
Sahil_Lather
88
views
data-structures
programming-in-c
dynamic-programming
0
votes
0
answers
33
TestBook TestSeries BFS Question to find 4th enqueue element
Consider the following graph. If BFS is implemented on the following graph where the root node is 1 then which of the following set of the nodes are present in the queue after performing 4th enqueue operation? 3, 4, 5 4, 6, 5 3, 4 4, 5, 6
Sahil_Lather
asked
in
Programming
Jan 28
by
Sahil_Lather
83
views
data-structures
graph-algorithms
0
votes
0
answers
34
TestBook testseries TLB and C programming combined question
Consider the following C function executed in an OS with paging where the page size is 4 kilobytes. Further, assume that the system employs a 32-entry direct mapped TLB. int *alloc_and_init() { int counter, value=0, size=2048; int ... of the program, what is the number of TLB misses during the execution of the for loop? 0 1 2048 2
Sahil_Lather
asked
in
Programming
Jan 28
by
Sahil_Lather
42
views
operating-system
programming-in-c
data-structures
pointers
0
votes
1
answer
35
Programming
Someone please explain. Function of ‘^’
mahendrapatel
answered
in
Programming
Jan 25
by
mahendrapatel
112
views
programming-in-c
self-doubt
test-series
102
votes
6
answers
36
GATE CSE 2015 Set 1 | Question: 35
What is the output of the following C code? Assume that the address of $x$ is $2000$ (in decimal) and an integer requires four bytes of memory. int main () { unsigned int x [4] [3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; printf ("%u, %u, %u", x + 3, *(x + 3), *(x + 2) + 3); } $2036, 2036, 2036$ $2012, 4, 2204$ $2036, 10, 10$ $2012, 4, 6$
mahendrapatel
answered
in
Programming
Jan 25
by
mahendrapatel
22.4k
views
gatecse-2015-set1
programming
programming-in-c
normal
45
votes
8
answers
37
GATE CSE 2014 Set 3 | Question: 12
Consider the following rooted tree with the vertex labeled $P$ as the root: The order in which the nodes are visited during an in-order traversal of the tree is $SQPTRWUV$ $SQPTUWRV$ $SQPTWUVR$ $SQPTRUWV$
Souvik33
answered
in
DS
Jan 25
by
Souvik33
13.0k
views
gatecse-2014-set3
data-structures
tree
easy
0
votes
0
answers
38
Made Easy
can anyone help me how to approach these type of questions..? And also please attach link of similar questions if possible . thanks in advance
TusharKumar
asked
in
Programming
Jan 24
by
TusharKumar
51
views
0
votes
2
answers
39
Programming and ds
How many number of add and remove operations are required to access 26th element of a queue of 50 elements,so that the original queue remains the same after the access is Note:-Direct accessing through the index is not included.
Sourin Kundu
asked
in
Programming
Jan 23
by
Sourin Kundu
102
views
programming-in-c
0
votes
1
answer
40
Ace Test series |C programming | What will be the output of the following program ?
What will be the output of the following program ? answer is 8 but I am getting 5, please explain where I am wrong
abhinowKatore
asked
in
Programming
Jan 18
by
abhinowKatore
236
views
programming-in-c
recursion
To see more, click for all the
questions in this category
.
Subscribe to GATE CSE 2023 Test Series
Subscribe to GO Classes for GATE CSE 2023
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Central Pollution Control Board CPCB Various Post Recruitment 2023
MP Rajya Sahkari Apex Bank Various Post Recruitment 2023
NITIE MUMBAI throgh GATE
PGCIL recruitment 2023 – Apply Online For 138 Posts through GATE
Admission guidance for GATE CSE 2023
Subjects
All categories
General Aptitude
(2.6k)
Engineering Mathematics
(9.4k)
Digital Logic
(3.3k)
Programming and DS
(5.9k)
Programming
(3.9k)
DS
(1.9k)
Algorithms
(4.6k)
Theory of Computation
(6.7k)
Compiler Design
(2.3k)
Operating System
(5.0k)
Databases
(4.6k)
CO and Architecture
(3.8k)
Computer Networks
(4.7k)
Non GATE
(1.3k)
Others
(2.5k)
Admissions
(655)
Exam Queries
(847)
Tier 1 Placement Questions
(17)
Job Queries
(77)
Projects
(9)
Unknown Category
(866)
Recent questions and answers in Programming and DS
Recent Blog Comments
Please see the updated link.
Unfortunately there won't be a hardcopy coming...
this book is not available on amazon now, i want...
Yes
Hi! @AnkitMazumder14 bhaiya,Is python...