search
Log In

Answers by Kaluti

0 votes
1
I want longest path from root to leaf. Then which code is correct among Code-1 or Code-2? Code-1) int tree(Struct node *root){ int a=0, b=0,c=0; if(root==NULL) return 0; if((root->left==NULL)&&(root->right==NULL)) return 1; a=1+tree(root->left); b=1+tree(root->right); c= ... 0; if((root->left==NULL)&&(root->right==NULL)) return 1; a=tree(root->left); b=tree(root->right); c=1+max(a,b); return c; }
answered May 22, 2019 in DS 101 views
0 votes
2
$I=$Iterative Program $R=$ Recursive Program $(A)$ For every program belonging to class $I$, there is an equivalent program to class $R.$ $(B)$ Every program in $R$ uses strictly more stack space compared to equivalent program in $I.$ Among $(A)$ and $(B)$ which one is correct?
answered May 22, 2019 in Programming 70 views
0 votes
3
Consider the following function with a binary tree with atleast one node: int path(struct node *x, int len){ if(x==NULL) return B; else return A; } Assume the above function is used to check the given binary tree has any path with specified length from root to the leaf node . Let $T$ ... $B$ is $(len== -1)$ which of these two option correct? Please Explain.
answered May 22, 2019 in DS 169 views
1 vote
4
A default catch block catches, [A]. all thrown objects [B]. no thrown objects [C]. any thrown object that has not been caught by an earlier catch block [D]. all thrown objects that have been caught by an earlier catch block
answered May 21, 2019 in Programming 127 views
0 votes
6
What kind of linked list is best to answer question like “What is the item at position n?” a) Singly linked list b) Doubly linked list c) Circular linked list d) Array implementation of linked list
answered Aug 21, 2018 in Programming 386 views
0 votes
7
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list? a) O(1) b) O(n) c) θ(n) d) θ(1)
answered Aug 20, 2018 in Programming 73 views
0 votes
8
How many element comparisons would heap sort use to sort the integers $1$ to $8$ if they were initially in sorted order, initially in reverse sorted order?
answered Jun 17, 2018 in DS 920 views
2 votes
9
Let $A$ be a $3\times 3$ matrix such that $\mid A-I \mid=0$.If trace of $A=13$ and $det A = 32$ then sum of squares of the eigen values of $A$ is ..... $82$ $13$ $169$ $81$
answered Mar 30, 2018 in Linear Algebra 1.2k views
3 votes
10
Suppose the rank of the matrix $\begin{pmatrix}1&1&2&2\\1&1&1&3\\a&b&b&1\end{pmatrix}$ is $2$ for some real numbers $a$ and $b$. Then $b$ equals $1$ $3$ $1/2$ $1/3$
answered Mar 30, 2018 in Linear Algebra 750 views
1 vote
11
A party of n persons take their seats at random at a round table,then the probability that two specified person do not sit together is $\left(\dfrac{2}{n-1}\right)$ $\left(\dfrac{n-3}{n-1}\right)$ $\left(\dfrac{n-2}{n-1}\right)$ $\left(\dfrac{1}{n-1}\right)$
answered Mar 30, 2018 in Probability 243 views
0 votes
13
Show that an edge in a simple graph is a cut edge if and only if this edge is not a part of any simple circuit in the graph.
answered Mar 18, 2018 in Graph Theory 84 views
0 votes
14
Let $X_1,X_2,X_3,X_4$ be i.i.d. random variables each assuming the value $1$ and $-1$ with probability $\dfrac{1}{2}$ each. Then, the probability that the matrix $\begin{pmatrix}X_1 &X_2\\ X_3 &X_4\end{pmatrix}$ is nonsingular equals $1/2$ $3/8$ $5/8$ $1/4$
answered Mar 17, 2018 in Probability 289 views
0 votes
15
A plane is missing and it is presumed that it was equally likely to have gone down in any of three possible regions. Let 1 − αi denote the probability the plane will be found upon a search of the ith region when the plane is, in fact, in that region, i = 1, 2, ... What is the conditional probability that the plane is in the ith region, given that a search of region 1 is unsuccessful, i = 1, 2, 3?
answered Mar 17, 2018 in Probability 147 views
0 votes
16
Consider the undirected graph $G$ defined as follows. The vertices of $G$ are bits of strings of length $n$. We have an edge between vertex $u$ and $v$ if and only if $u$ and $v$ differ exactly in one bit position. The ratio of chromatic number of $G$ to the diameter of $G$ is . $\dfrac{1}{(2^{n-1})}$ $\dfrac{1}{n}$ $\dfrac{2}{n}$ $\dfrac{3}{n}$
answered Mar 17, 2018 in Graph Theory 109 views
0 votes
17
Every student in this class has studied calculus If S(x) represents the statement that person x is in this class, C(x) which is the statement x has studied calculus. we see that our statement can beexpressed as ∀x(S(x) → C(x) ) Some student in this class has visited Mexico M(x), ... class. ∃x(S(x) ∧ M(x)) In 1st example Implication is taken Why in 2nd Example and is taken why not S(x) ->M(x)
answered Mar 4, 2018 in Mathematical Logic 135 views
2 votes
18
which statement is true? 1)for any data file it is possible to construct two separate sparse first level index on different keys. 2)for any data file it is possible to construct two separate dense first level index on different keys. 3)for any data file it is possible to construct a sparse first level index and a dense second level indexboth should be useful 4) none.
answered Jan 13, 2018 in Databases 680 views
1 vote
19
How many concurrent schedules are conflict serializable of given transactions T1 and T2: T1 = r1(A) W1(A)R1(B)W1(B) T2 = R2(B)W2(B)R2(A)W2(A)
answered Jan 13, 2018 in Databases 210 views
0 votes
20
0 votes
21
If all state of DFA is final then it accpets $\sum$ (i.e) regular true or false
answered Oct 16, 2017 in Theory of Computation 206 views
0 votes
22
What should be the minimum & maximum sampling rate for NYQUIST THEOREM?
answered Oct 16, 2017 in Computer Networks 365 views
0 votes
23
Turing machine can be constructed by FA with 2 stacks??
answered Oct 16, 2017 in Theory of Computation 122 views
0 votes
24
Let the homomorphism defined over alphabet Σ{0, 1} is h(0) = aa and h(1) = aba, and L = (ab + ba)*a then what is h-1(L)?
answered Oct 4, 2017 in Theory of Computation 126 views
1 vote
25
there is a proof for equivalence of empty stack and final state but what about the prefix property cases empty stack cant accept regular languages which donot accept the prefix property isnt it less powerful than the acceptance by final state ?? what kind of equivalence they have ??
answered Oct 4, 2017 in Theory of Computation 159 views
1 vote
26
A decimal parallel adder that add n decimal digits needs how many BCD adder stages 1. n 2. 2n 3. 1 4 n^2
answered Oct 4, 2017 in Digital Logic 884 views
0 votes
27
for fintie autometa of n state the max lenght of string that must be consider to distinguish two state is- 1. n 2. n-1 3 n-2 4.none
answered Oct 2, 2017 in Theory of Computation 47 views
0 votes
28
This question I have many doubts like (1) what are those final states (2) what is the meaning of phyi here (3) from state q0 n q1 when EPSILON input is given what is its meaning (4) plz someone draw the PDA diag. (5) Plz give the language also (6) And lastly what the answar
answered Oct 1, 2017 in Theory of Computation 160 views
...