Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Answers by vipsharmavip
1
votes
1
TIFR CSE 2012 | Part B | Question: 15
Let $T$ be a tree of $n$ nodes. Consider the following algorithm, that constructs a sequence of leaves $u_{1}, u_{2}...$. Let $u_{1}$ be some leaf of tree. Let $u_{2}$be a leaf that is farthest from $u_{1}$ ... . For the same tree, the distance between the last two vertices visited can be different, based on the choice of the first leaf $u_{1}$.
Let $T$ be a tree of $n$ nodes. Consider the following algorithm, that constructs a sequence of leaves $u_{1}, u_{2}...$. Let $u_{1}$ be some leaf of tree. Let $u_{2}$be ...
3.9k
views
answered
Jan 20, 2017
DS
tifr2012
data-structures
tree
+
–
0
votes
2
Recursion
#define LIMIT 1000 void fun2(int n) { if (n <= 0) return; if (n > LIMIT) return; printf("%d ", n); fun2(2*n); printf("%d ", n); } Will it be non terinating recursion if n is negative,if so then why?
#define LIMIT 1000void fun2(int n){ if (n <= 0) return; if (n LIMIT) return; printf("%d ", n); fun2(2*n); printf("%d ", n);} Will it be non terinating recur...
463
views
answered
Jan 20, 2017
1
votes
3
Saurabh school lect..i think thiz is wrong interpretation..rt?
407
views
answered
Jan 20, 2017
3
votes
4
probability
Out of (2n + 1) tickets consecutively numbered three are drawn at random. Find the probability that the numbers on them are in arithmetic progression? 3n/4n2-1 2n/4n2-1 2n/4n2+1 2n/2n2+1
Out of (2n + 1) tickets consecutively numbered three are drawn at random. Find the probability that the numbers on them are in arithmetic progression?3n/4n2-12n/4n2-12n/4...
1.5k
views
answered
Jan 20, 2017
3
votes
5
External fragmentation
The available main memory for loading processes is 128 MB which is divided into fixed number of partitions each of size 16 MB. If the processes of size 12 MB,18MB and 20 MB are loaded into memory. The percentage of the external fragmentation is ____________ (upto two decimal places)
The available main memory for loading processes is 128 MB which is divided into fixed number of partitions each of size 16 MB. If the processes of size 12 MB,18MB and 20 ...
1.5k
views
answered
Jan 20, 2017
3
votes
6
MadeEasy Subject Test: Algorithms - Time Complexity
A program takes input of a binary tree with N nodes and computes a function f(x)=max height of left subtree-max height of right subtree what is the time complexity?
A program takes input of a binary tree with N nodes and computes a function f(x)=max height of left subtree-max height of right subtreewhat is the time complexity?
949
views
answered
Jan 20, 2017
DS
data-structures
binary-tree
time-complexity
made-easy-test-series
+
–
1
votes
7
test series
364
views
answered
Jan 19, 2017
Programming in C
test-series
programming-in-c
+
–
2
votes
8
Graph Theory
How to learn and understand graph theory in 23 days i mean before gate exam? Can anybody help in this.Like there are many new terms bipartite graph etc etc i m not able to learn some complicated names ? Any video lectures or anything please help :)
How to learn and understand graph theory in 23 days i mean before gate exam? Can anybody help in this.Like there are many new terms bipartite graph etc etc i m not able ...
464
views
answered
Jan 17, 2017
Graph Theory
graph-theory
+
–
5
votes
9
time complexity
given a N-bit string. what is the time complexity to find out all subsets of that string which is parlindrome?
given a N-bit string.what is the time complexity to find out all subsets of that string which is parlindrome?
944
views
answered
Jan 17, 2017
Algorithms
time-complexity
dynamic-programming
+
–
0
votes
10
doubt
330
views
answered
Jan 17, 2017
Programming in C
algorithms
+
–
8
votes
11
What is the expected length of the cycle containing vertex 1?
A random permutation π of set[n] = {1, 2, , n} can be represent by a directed graph on n vertices with directed arc (i, πi) where πi is the ith entry in the permutation. Observe that the resulting graph is just a collection of disjoint cycles. ... containing vertex 1? n(n-1)/2n (n+1)/2n ((n-1))/2 ((n+1))/2 /pls explain the question
A random permutation π of set[n] = {1, 2, …, n} can be represent by a directed graph on n vertices with directed arc (i, πi) where πi is the ith entry in the permuta...
1.7k
views
answered
Jan 16, 2017
Graph Theory
expectation
graph-theory
engineering-mathematics
+
–
3
votes
12
discrete
How many solutions are there to the equation: $X_1+X_2+X_3+X_4+X_5=21$ ? If $0 \leq X1 \leq 3 , 1 \leq X2 < 4 , X3 \geq 15$
How many solutions are there to the equation: $X_1+X_2+X_3+X_4+X_5=21$ ?If $0 \leq X1 \leq 3 , 1 \leq X2 < 4 , X3 \geq 15$
774
views
answered
Jan 14, 2017
0
votes
13
hoe many different choices for classes does we have? ________
Tom Riddle must choose 4 classes for his final semester at school. He must take at least 1 science class and at least 1 art class. In his school offers 4 (distinct) science classes, 3 (distinct) art classes and three other (distinct) classes, hoe many different choices for classes does we have? ________ 195 175 210 160
Tom Riddle must choose 4 classes for his final semester at school. He must take at least 1 science class and at least 1 art class. In his school offers 4 (distinct) scien...
720
views
answered
Jan 13, 2017
Combinatory
combinatory
+
–
1
votes
14
DS-CLL
Time complexity to insert a node in the end of circular linked list, if the pointer to the 1st node is given and number of nodes in list is N is A)O(1) B)O(log N) C)O(N) D)O(N log N)
Time complexity to insert a node in the end of circular linked list, if the pointer to the 1st node is given and number of nodes in list is NisA)O(1)B)O(log N)C)O(N)D)O(N...
3.0k
views
answered
Jan 12, 2017
DS
data-structures
time-complexity
algorithms
linked-list
+
–
0
votes
15
testbook
512
views
answered
Jan 11, 2017
Theory of Computation
testbook-test-series
test-series
theory-of-computation
+
–
1
votes
16
DS-BFS
a)(d,c) b)(d,b) c)(e,b) d)(e,f)
a)(d,c)b)(d,b)c)(e,b)d)(e,f)
1.7k
views
answered
Jan 10, 2017
DS
breadth-first-search
+
–
5
votes
17
DS-Programming
Consider the following code
Consider the following code
478
views
answered
Jan 10, 2017
Programming in C
output
+
–
1
votes
18
insert_front_linkedlist
278
views
answered
Jan 2, 2017
1
votes
19
number of record movement
346
views
answered
Dec 31, 2016
Algorithms
algorithms
graph-algorithms
space-complexity
test-series
+
–
1
votes
20
algo. book
Running time of following program? function(n) { for( i = 1 ; i <= n ; i + + ) for( j = 1 ; j <= n ; j+ = i ) print("*") ; }
Running time of following program? function(n) { for( i = 1 ; i <= n ; i + + ) for( j = 1 ; j <= n ; j+ = i ) print("*") ; }
260
views
answered
Dec 31, 2016
Algorithms
time-complexity
+
–
3
votes
21
Algorithm
$N$ detectors are installed along the edge of a road of length $L$ at different positions (position[N]). Each detector has some predefined range (range[N]) of coverage along the length of the road as shown in the figure below. Detectors are powerful enough to cover the full width of the road. ...
$N$ detectors are installed along the edge of a road of length $L$ at different positions (position[N]). Each detector has some predefined range (range[N]) of coverage al...
490
views
answered
Dec 31, 2016
Algorithms
algorithms
time-complexity
+
–
6
votes
22
C programming
#define Raining 0x04 int bring_flower(unsigned u) { return (u & Raining == 0) ? 0 : 1; } int main() { printf("%d\n",bring_flower(0x1B)); return 0; } Above program $\rightarrow$ Always returns 0 0 when the Third rightmost bit of the input to bring_flower is 0 1 when the Third rightmost bit of the input to bring_flower is 1 Always returns 1
#define Raining 0x04 int bring_flower(unsigned u) { return (u & Raining == 0) ? 0 : 1; } int main() { printf("%d\n",bring_flower(0x1B)); return 0; }Above program $\righta...
334
views
answered
Dec 29, 2016
Programming in C
programming-in-c
output
+
–
5
votes
23
Combinatorics
The answer given is n-k+1C2 but couldn't understand how both are related
The answer given is n-k+1C2 but couldn't understand how both are related
542
views
answered
Dec 29, 2016
Combinatory
combinatory
discrete-mathematics
+
–
4
votes
24
Recurrence Relation
The recurrence relation for the number of n-digit quaternary sequences that have an even number of zeros (quaternary sequences use only 0,1,2,3 for digits) is- (A) an = an-1 + 4n-1 (B) an = 3an-1 + 4n-1 (C) an = 2an-1 + 4n-1 (D) an = an-1 + 4n-2
The recurrence relation for the number of n-digit quaternary sequences that have an even number of zeros (quaternary sequences use only 0,1,2,3 for digits) is-(A) an = an...
1.6k
views
answered
Dec 29, 2016
1
votes
25
Number of Solutions for the quation
How many integral solutions exist for the system of equations x+y+z =15 where 0<=x,y,z<=10 ? Ans given is 620. I am getting 91 Could someone point out the flaw in the below logic? Mehod Used : There are 10 stars and 3 bins with multi choose 17C2 = 136 Invalid Solutions (Any of them assigned >=11 ) 3C1 * N( x+y+z = 4) => 3*6C2 = 15 *3 =45 136-45=91
How many integral solutions exist for the system of equations x+y+z =15 where 0<=x,y,z<=10 ? Ans given is 620. I am getting 91Could someone point out the flaw in the belo...
345
views
answered
Dec 29, 2016
Combinatory
combinatory
discrete-mathematics
+
–
1
votes
26
self doubta
please explain these few point: how is longest path between any pair of vertices different from diameter of a agraph.? in dijkstra algorithm,each edge is relaxed eaxtly one time..is it true or false?
please explain these few point:how is longest path between any pair of vertices different from diameter of a agraph.?in dijkstra algorithm,each edge is relaxed eaxtly one...
494
views
answered
Dec 28, 2016
Algorithms
graph-theory
dijkstras-algorithm
true-false
+
–
3
votes
27
Suppose we have a heap containing n = 2k elements in an array of size ‘n’
Suppose we have a heap containing n = 2k elements in an array of size n', and suppose that we repeatedly extract the minimum element, n' times, never performing insertions. To make the heap space efficient, we move the heap ... the Θ(n log n) cost from the heapify operations themselves. Θ(n) Θ(2n) Θ(logn) Θ(nlogn)
Suppose we have a heap containing n = 2k elements in an array of size ‘n’, and suppose that we repeatedly extract the minimum element, ‘n’ times, never performing...
1.4k
views
answered
Dec 28, 2016
Algorithms
algorithms
time-complexity
+
–
3
votes
28
Consider an algorithm A which solves problems by dividing them into seven sub-problems
Consider an algorithm A which solves problems by dividing them into seven sub-problems each with half the size of the original problem, recursively solving each subproblem, and then combining the solutions in linear time. What is ... this algorithm? Almost equal to O(n2) Almost equal to O(n3) O(2n) None of these
Consider an algorithm A which solves problems by dividing them into seven sub-problems each with half the size of the original problem, recursively solving each subproble...
5.6k
views
answered
Dec 28, 2016
Algorithms
algorithms
time-complexity
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register