Recent questions in Programming and DS

#41
502
views
1 answers
4 votes
What will be the output of the following C program?#include <stdio.h>void Mickey(int , int, int);void Mouse(int, int*);int main(){ int a = 2, b = 3, c = 4; int *poi...
#42
590
views
2 answers
5 votes
Let $B$ be a binary search tree (BST) with eight nodes filled with the following set of eight integer keys $A=\{10,2,5,3,20,15,9,22\}$. The order in which these keys were...
#43
622
views
1 answers
7 votes
Consider a stack whose elements are unsigned integers and support the following operations:PUSH a: Pushes the element 'a' onto the stack.ADD: Adds the two topmost element...
#44
289
views
1 answers
4 votes
Consider the following pseudocode procedure.Which of the following best describes procedure mystery?It returns a list of numbers from 1 to $n$.It prints every third numbe...
#45
153
views
0 answers
0 votes
Consider the following Python code:S = x = [6, 3, 5, 4, 10]for i in range(2, len(x)):    S[i] =     if x[i - 1]
#46
122
views
0 answers
0 votes
What does the following Python code do?\begin{verbatim}def fun(D, S_1, S_2):    if S_1 < S_2:        D[S_1], D[S_2] = D[S_2], D[S_1]        fun(D, S_1...
#47
430
views
2 answers
2 votes
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree?Inorder + PreorderPreorder + PostorderOnly InorderInorde...
#48
263
views
1 answers
0 votes
Consider a doubly linked list with the following operations:- Insert First (\texttt{InsertFirst})\\- Insert Last (\texttt{InsertLast})\\- Remove First (\texttt{RemoveFirs...
#49
242
views
1 answers
0 votes
Match the following:$$\begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|}    \hline    \textbf{Technique} & \textbf{Characteristic} \\    \hline    FIFO & ...
#50
149
views
0 answers
0 votes
Consider the following Python code:def countchildren(l, i):    Some code    Given lists    if i 2:        return 1    ans = 1    for i in l.k...
#51
266
views
0 answers
0 votes
Data Structure question: Binary tree question having four options involving no of internal nodes, leaf nodes, height etc.
#52
355
views
1 answers
1 votes
In what cases does an uninitialized array have values = 0 and for which cases does it have values = garbage values. How to differentiate?
#53
223
views
1 answers
1 votes
Does C support fractional Indices?float x = some fraction;Is float a[x] valid declaration?
#54
537
views
1 answers
6 votes
Suppose we constructed the binary search tree shown by starting with an empty tree and inserting one element at a time from an input sequence, without any rotations or ot...
#55
587
views
1 answers
3 votes
Suppose that a binary min-heap stores six elements with priorities $10,20,30,40,50$, and $60$ in its array $\text{A}.$ What is the largest of these items that could be st...
#56
448
views
1 answers
5 votes
What will be output printed by the following program?#include<stdio.h main() { int c=4; switch(c) { c=c-1; case 4: printf("IITB ")...
#57
367
views
0 answers
4 votes
What will be the output of the following program?#include <stdio.h int main() { int a = { {1, 2}, {3, 4} }; int (*p) ; p = &a; printf("%d", (*p)[0] ); return 0; }$1$$2...
#58
463
views
1 answers
3 votes
Let $\mathrm{T}$ be the smallest AVL tree of height $h$. How many nodes does it have, if the smallest AVL tree of height $h-2$ has $m$ nodes and the smallest AVL tree of ...
#59
520
views
2 answers
4 votes
Consider the null-terminated linked list of four integers $\textsf{1->2->3->4->NULL},$ and the variable 'list' points to the head of the linked list. Upon running the pro...
#60
911
views
3 answers
7 votes
You are given a complete binary tree (each level must be full except the last) on $n$ vertices. Each vertex $v$ is labeled by an integer value $x_v$. Say that a vertex is...