Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged data-structures
8
votes
2
answers
151
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)$
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...
admin
10.3k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
linked-list
1-mark
+
–
7
votes
3
answers
152
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))$.
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...
admin
6.1k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
priority-queue
time-complexity
heap
2-marks
+
–
8
votes
2
answers
153
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$
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; i...
admin
6.6k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
binary-tree
2-marks
+
–
6
votes
3
answers
154
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 ______________.
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,$ b...
admin
6.6k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
stack
numerical-answers
2-marks
easy
+
–
2
votes
1
answer
155
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$
Which one of the following sequences when stored in an array at locations A ,...,A[10] forms a max-heap?$23\; 17\; 10\; 6\; 13\; 14\; 1\; 5 \;9 \;12$$23 \;14 \;19 \;1 \;1...
GO Classes
4.9k
views
GO Classes
asked
Feb 5, 2023
DS
memorybased-gatecse2023
goclasses
data-structures
binary-heap
+
–
0
votes
1
answer
156
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; }
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#i...
Souvik33
448
views
Souvik33
asked
Jan 29, 2023
Programming in C
data-structures
programming-in-c
+
–
1
votes
1
answer
157
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
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 t...
Sahil_Lather
365
views
Sahil_Lather
asked
Jan 28, 2023
Programming in C
data-structures
programming-in-c
dynamic-programming
+
–
0
votes
0
answers
158
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
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 ...
Sahil_Lather
303
views
Sahil_Lather
asked
Jan 28, 2023
Programming in C
data-structures
graph-algorithm
+
–
0
votes
0
answers
159
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
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.i...
Sahil_Lather
205
views
Sahil_Lather
asked
Jan 28, 2023
Programming in C
operating-system
programming-in-c
data-structures
pointers
+
–
0
votes
1
answer
160
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
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...
Sahil_Lather
785
views
Sahil_Lather
asked
Jan 28, 2023
DS
data-structures
linked-list
+
–
1
votes
1
answer
161
Made Easy Test Series | Prog And DS | Linked List
The following C function rearranges the members of a single-linked list of integers that is passed as a parameter. The list of numbers 1, 2, 3, 4, 5, 6, and 7 in the specified order is passed to the function when it is called. How many components will move about in the list once the function is finished running?
The following C function rearranges the members of a single-linked list of integers that is passed as a parameter. The list of numbers 1, 2, 3, 4, 5, 6, and 7 in the spec...
Souvik33
729
views
Souvik33
asked
Jan 11, 2023
Programming in C
programming-in-c
made-easy-test-series
data-structures
linked-list
+
–
1
votes
0
answers
162
Made Easy Test Series | Prog. and DS | Dynamic Memory Allocation | Malloc
Which line number contains an error or warning:
Which line number contains an error or warning:
Souvik33
687
views
Souvik33
asked
Jan 9, 2023
Programming in C
programming-in-c
data-structures
memory-management
made-easy-test-series
numerical-answers
+
–
0
votes
0
answers
163
Tree
damz1499
380
views
damz1499
asked
Dec 29, 2022
DS
data-structures
binary-tree
probability
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
...
60
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register