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
Webpage
Programming in C.
Recursion.
Recent activity in Programming and DS
0
votes
1
answer
1
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
Pranavpurkar
commented
in
Programming
2 hours
ago
by
Pranavpurkar
12
views
data-structures
pointers
programming-in-c
12
votes
3
answers
2
GATE CSE 2021 Set 1 | Question: 10
A binary search tree $T$ contains $n$ distinct elements. What is the time complexity of picking an element in $T$ that is smaller than the maximum element in $T$? $\Theta(n\log n)$ $\Theta(n)$ $\Theta(\log n)$ $\Theta (1)$
TusharRana
commented
in
DS
18 hours
ago
by
TusharRana
6.4k
views
gatecse-2021-set1
data-structures
binary-search-tree
time-complexity
26
votes
2
answers
3
GATE CSE 1997 | Question: 17
An array $A$ contains $n \geq 1$ positive integers in the locations $A[1], A[2], \dots A[n]$. The following program fragment prints the length of a shortest sequence of consecutive elements of $A$, $A[i], A[i+1], \dots,A[j]$ ... ◻ end else begin if(j-i) < min then min:=j-i; sum:=sum -A[i]; i:=i+1; end writeln (min +1); end.
Abdulhameed
commented
in
DS
19 hours
ago
by
Abdulhameed
3.9k
views
gate1997
data-structures
array
normal
descriptive
47
votes
3
answers
4
GATE CSE 2012 | Question: 5
The worst case running time to search for an element in a balanced binary search tree with $n2^{n}$ elements is $\Theta(n\log n)$ $\Theta(n2^n)$ $\Theta(n)$ $\Theta(\log n)$
TusharRana
answered
in
DS
19 hours
ago
by
TusharRana
10.0k
views
gatecse-2012
data-structures
normal
binary-search-tree
29
votes
8
answers
5
GATE CSE 2007 | Question: 43
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complete $n-ary$ tree. If $L = 41$ and $I = 10$, what is the value of $n$? $3$ $4$ $5$ $6$
Durgeshkumar
commented
in
DS
22 hours
ago
by
Durgeshkumar
22.2k
views
gatecse-2007
data-structures
tree
normal
24
votes
2
answers
6
GATE CSE 1994 | Question: 1.20
In which of the following cases is it possible to obtain different results for call-by-reference and call-by-name parameter passing methods? Passing a constant value as a parameter Passing the address of an array as a parameter Passing an array element as a parameter Passing an array
Pranavpurkar
comment edited
in
Programming
1 day
ago
by
Pranavpurkar
8.2k
views
gate1994
programming
parameter-passing
easy
6
votes
1
answer
7
TIFR CSE 2016 | Part B | Question: 5
Consider the recursive function $\mathsf{mc91}$ ... $\{ n: 0 \leq n \leq 110 \}$ $\{ n: 0 \leq n \leq 111 \}$ $\{ n: 0 \leq n < + \infty \}$
Lakshman Patel RJIT
recategorized
in
Programming
4 days
ago
by
Lakshman Patel RJIT
377
views
tifr2016
programming-in-c
recursion
145
votes
15
answers
8
GATE CSE 2016 Set 2 | Question: 40
The number of ways in which the numbers $1, 2, 3, 4, 5, 6, 7$ can be inserted in an empty binary search tree, such that the resulting tree has height $6$, is _________. Note: The height of a tree with a single node is $0$.
Pranavpurkar
commented
in
DS
4 days
ago
by
Pranavpurkar
38.0k
views
gatecse-2016-set2
data-structures
binary-search-tree
normal
numerical-answers
7
votes
4
answers
9
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 $H$? $\Theta (1)$ $\Theta (\log n)$ $\Theta (n)$ $\Theta (n \log n)$
shriram
answered
in
DS
Nov 21
by
shriram
4.3k
views
gatecse-2021-set2
data-structures
heap
binary-heap
time-complexity
3
votes
2
answers
10
GO Classes 2023 | Weekly Quiz 4 | Question: 19
What will be the output printed by $\text{mystery}1(0,6)$? void mystery1(int a, int b) { if (a <= b) { int m = (a + b) / 2; printf("%d", m); mystery1(a, m-1); mystery1(m+1, b); } }
Amlan Kumar Majumdar
commented
in
Programming
Nov 21
by
Amlan Kumar Majumdar
270
views
goclasses_wq4
goclasses
programming
programming-in-c
recursion
numerical-answers
1-mark
1
vote
1
answer
11
UGC NET CSE | December 2015 | Part 2 | Question: 38
The inorder traversal of the following tree is $2 \, \, \, 3 \, \, \, 4 \, \, \, 6 \, \, \, 7 \, \, \, 13 \, \, \, 15 \, \, \, 17 \, \, \, 18 \, \, \, 18 \, \, \, 20$ ...
gatecse
edited
in
DS
Nov 20
by
gatecse
1.5k
views
ugcnetcse-dec2015-paper2
data-structures
tree-traversal
15
votes
5
answers
12
TIFR CSE 2018 | Part A | Question: 7
Consider the following function definition. void greet(int n) { if(n>0) { printf("hello"); greet(n-1); } printf("world"); } If you run $\textsf{greet(n)}$ ... "helloworld" $\textsf{n+1}$ times "helloworld" $\textsf{n}$ times "helloworld", followed by "world"
Lakshman Patel RJIT
edited
in
Programming
Nov 20
by
Lakshman Patel RJIT
2.2k
views
tifr2018
programming
programming-in-c
recursion
1
vote
2
answers
13
TIFR CSE 2020 | Part B | Question: 12
Given the pseudocode below for the function $\textbf{remains()}$, which of the following statements is true about the output, if we pass it a positive integer $n>2$? int remains(int n) { int x = n; for (i=(n-1);i>1;i--) { x = x % i ; } ... $1$ Output is $0$ only if $n$ is NOT a prime number Output is $1$ only if $n$ is a prime number None of the above
Lakshman Patel RJIT
recategorized
in
Programming
Nov 20
by
Lakshman Patel RJIT
568
views
tifr2020
programming
programming-in-c
functions
2
votes
1
answer
14
TIFR CSE 2021 | Part B | Question: 6
Consider the following pseudocode: procedure HowManyDash(n) if n=0 then print '-' else if n=1 then print '-' else HowManyDash(n-1) HowManyDash(n-2) end if end procedure How many ‘-’ does HowManyDash$(10)$ print? $9$ $10$ $55$ $89$ $1024$
Lakshman Patel RJIT
recategorized
in
Programming
Nov 20
by
Lakshman Patel RJIT
269
views
tifr2021
programming
recursion
1
vote
1
answer
15
TIFR CSE 2021 | Part B | Question: 2
Let $L$ be a singly-linked list $X$ and $Y$ be additional pointer variables such that $X$ points to the first element of $L$ and $Y$ points to the last element of $L$. Which of the following operations cannot be done in time that is ... after the last element of $L$. Add an element before the first element of $L$. Interchange the first two elements of $L$.
Lakshman Patel RJIT
recategorized
in
DS
Nov 20
by
Lakshman Patel RJIT
351
views
tifr2021
data-structures
linked-list
2
votes
3
answers
16
TIFR CSE 2021 | Part B | Question: 3
What is the prefix expression corresponding to the expression: $\left ( \left ( 9+8 \right ) \ast 7+\left ( 6\ast \left ( 5+4 \right ) \right )\ast 3\right )+2?$ You may assume that $\ast$ has precedence over $+$? $\ast + +\: 987 \ast \ast \: 6 + + \:5432$ ... $+ + \ast +\: 987 \ast \ast \: 6 + \:5432$ $+ \ast + \ast \: 987+ + \: 6 \ast \:5432$
Lakshman Patel RJIT
recategorized
in
DS
Nov 20
by
Lakshman Patel RJIT
342
views
tifr2021
data-structures
stack
infix-prefix
1
vote
1
answer
17
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 $
Lakshman Patel RJIT
recategorized
in
DS
Nov 20
by
Lakshman Patel RJIT
78
views
tifr2022
data-structures
linked-list
1
vote
1
answer
18
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
Lakshman Patel RJIT
recategorized
in
DS
Nov 20
by
Lakshman Patel RJIT
135
views
tifr2022
data-structures
queue
81
votes
6
answers
19
GATE CSE 2016 Set 2 | Question: 15
$N$ items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations ... together? $O(\log^{2} N)$ $O(N)$ $O(N^{2})$ $\Theta\left(N^{2}\log N\right)$
Tmajestical
commented
in
DS
Nov 19
by
Tmajestical
26.5k
views
gatecse-2016-set2
data-structures
linked-list
time-complexity
normal
algorithms
20
votes
9
answers
20
GATE CSE 2021 Set 2 | Question: 10
Consider the following $\text{ANSI C}$ program. #include <stdio.h> int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) { for (j=0; j<5; j++) { arr[i][j] = 10 * i + j; } } printf(“%d”, *(arr[1]+9)); return 0; } What is the output of the above program? $14$ $20$ $24$ $30$
Tushar03
answered
in
Programming
Nov 19
by
Tushar03
20.4k
views
gatecse-2021-set2
programming-in-c
array
output
3
votes
2
answers
21
Programming
I read Dennis Ritchie and i am little bit confused abt some Concepts on Pointers:- Two Complicated Declarations which I didnt get:- 1. char (*(*x())[])() :- x = Function returning pointer to array[] of pointer to function returning char. 2. char(*(*X[3])())[5] :- X = array[3] of pointer to function returning pointer to array[5] of char.
jomboy
answered
in
Programming
Nov 19
by
jomboy
209
views
programming-in-c
programming
0
votes
2
answers
22
Made Easy test series DS
Consider a binary tree where for every node ⏐P – Q⏐ ≤ 2. P represents number of nodes in left sub tree for node S and Q represents the number of nodes in right sub tree for node S for h > 0. The minimum number of nodes present in such binary tree of height h = 4 _________. (Assume root is at height 0)
shub2204
commented
in
DS
Nov 15
by
shub2204
1.1k
views
data-structures
binary-tree
made-easy-test-series
numerical-answers
2
votes
1
answer
23
#topological
number of toplogical sort sequence
Chandrabhan Vishwa 1
commented
in
DS
Nov 13
by
Chandrabhan Vishwa 1
502
views
topological-sort
21
votes
4
answers
24
GATE CSE 1996 | Question: 15
Insert the characters of the string $K \ R \ P \ C \ S \ N \ Y \ T \ J \ M$ into a hash table of size $10$. Use the hash function $h(x)=( ord (x) – ord (\text{“}a\text{”}) + 1) \mod 10$ and linear probing to resolve collisions. Which insertions cause collisions? Display the final hash table.
pratik2404
commented
in
DS
Nov 13
by
pratik2404
4.8k
views
gate1996
data-structures
hashing
normal
descriptive
0
votes
1
answer
25
Self-Doubt: Stack Overflow in LinkedList
Can there be “Stack Overflow” in Linked list Implementation of stack? If Yes, how?
Abhrajyoti00
answer selected
in
DS
Nov 13
by
Abhrajyoti00
105
views
stack
data-structures
linked-list
6
votes
2
answers
26
test series
extern int i; int i=5; i=10; int main() { printf("\ni=%d",i); return 0; } output is?
Hanan05
answered
in
Programming
Nov 12
by
Hanan05
826
views
programming-in-c
extern
variable-scope
63
votes
10
answers
27
GATE CSE 2010 | Question: 53
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: \mod \: 10$, and linear probing. After inserting $6$ ... of the key values using the same hash function and linear probing will result in the hash table shown above? $10$ $20$ $30$ $40$
Abhrajyoti00
commented
in
DS
Nov 12
by
Abhrajyoti00
21.2k
views
data-structures
hashing
normal
gatecse-2010
0
votes
0
answers
28
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
asked
in
Programming
Nov 11
by
damz1499
92
views
programming-in-c
0
votes
2
answers
29
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.
jenova
answered
in
Programming
Nov 10
by
jenova
61
views
data-structures
stack
infix-prefix
57
votes
12
answers
30
GATE CSE 2015 Set 2 | Question: 11
Consider the following C function. int fun(int n) { int x=1, k; if (n==1) return x; for (k=1; k<n; ++k) x = x + fun(k) * fun (n-k); return x; } The return value of $fun(5)$ is ______.
jenova
answered
in
Algorithms
Nov 9
by
jenova
15.9k
views
gatecse-2015-set2
algorithms
identify-function
recurrence-relation
normal
numerical-answers
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
POWER GRID CORPORATION OF INDIA LIMITED
INSTITUTE OF BANKING PERSONNEL SELECTION
GATE Overflow books for TIFR, ISRO, UGCNET and NIELIT
RECRUITMENT IN OIL AND GAS CORPORATION LIMITED
Aptitude Overflow Book
Subjects
All categories
General Aptitude
(2.4k)
Engineering Mathematics
(9.1k)
Digital Logic
(3.2k)
Programming and DS
(5.8k)
Programming
(3.9k)
DS
(1.8k)
Algorithms
(4.5k)
Theory of Computation
(6.6k)
Compiler Design
(2.3k)
Operating System
(4.9k)
Databases
(4.5k)
CO and Architecture
(3.7k)
Computer Networks
(4.5k)
Non GATE
(1.3k)
Others
(2.4k)
Admissions
(647)
Exam Queries
(841)
Tier 1 Placement Questions
(17)
Job Queries
(74)
Projects
(9)
Unknown Category
(855)
Recent activity in Programming and DS
Recent Blog Comments
@abir_banerjee Thanks Abir. I'm third year...
@nolan_keats Currently I am in third year...
@abir_banerjee thank you Abir.Supposing you...
@nolan_keats just a suggestion as I also...
@abir_banerjee Hope I can do this in span of one...