Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
2
votes
1
answer
1981
time complexity
If F(n) = (log n)n then, is F(n) = O(n2) true? Also, what about F(n) = $\Theta$(n2)
If F(n) = (log n)n then, is F(n) = O(n2) true?Also, what about F(n) = $\Theta$(n2)
Warlock lord
284
views
Warlock lord
asked
Sep 11, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
0
votes
1
answer
1982
time complexity
a[] is an array of integer, the size of the array is n. Read the following code snippet and find the time complexity of the code. int main(){ int i,j,k=0; for(i=0;i<n;i++){ for(j=0;j<i;j++){ while(k<i && a[j]<a[k]){ k++; } } } }
a[] is an array of integer, the size of the array is n.Read the following code snippet and find the time complexity of the code. int main(){int i,j,k=0;for(i=0;i<n;i++)...
Warlock lord
594
views
Warlock lord
asked
Sep 10, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
1
votes
0
answers
1983
Virtual Gate Test Series: Algorithms - Tree Coloring
Consider a tree with $n$ nodes where a node can be adjacent to max $4$ other nodes what is the minimum number of colors needed to color the tree so that no two adjacent nodes get the same color?
Consider a tree with $n$ nodes where a node can be adjacent to max $4$ other nodes what is the minimum number of colors needed to color the tree so that no two adjacent n...
kunalv
349
views
kunalv
asked
Sep 10, 2017
Algorithms
algorithms
graph-coloring
tree-coloring
virtual-gate-test-series
+
–
0
votes
1
answer
1984
Minimum Spanning Trees
Suppose, the MST of a graph of n vertices has already been constructed. Now, if one new vertex is added to the graph along with 'i' incident edges. What is the max number of edges that can change in MST of new graph w.r.t to old MST? a) 1 b) n c) Number of incident edges on new vertex n-i d) none of these
Suppose, the MST of a graph of n vertices has already been constructed. Now, if one new vertex is added to the graph along with 'i' incident edges. What is the max number...
AsiaPacific
692
views
AsiaPacific
asked
Sep 10, 2017
Algorithms
minimum-spanning-tree
algorithms
+
–
3
votes
0
answers
1985
cormen
Show that a graph has a unique minimum spanning tree if, for every cut of the graphs, there is a unique line edge crossing the cut. Show that the converse is not true by giving a counter example. I'm more interested in the converse. Please explain in detail.
Show that a graph has a unique minimum spanning tree if, for every cut of the graphs, there is a unique line edge crossing the cut. Show that the converse is not true by ...
Warlock lord
825
views
Warlock lord
asked
Sep 9, 2017
Algorithms
algorithms
minimum-spanning-tree
+
–
0
votes
1
answer
1986
Coding String
Input You are given a template in which you need to implement a function whose signature is given below. C int findWordInAGrid(char grid[128][128], int m, int n, char word[32]) /* return 0 for false, 1 for true. */ C++ bool findWordInAGrid(char grid[128] ... abc abedhi efgh Output: The output of the above example should be: abc: true abedhi: true efgh: false Constraints 1 ≤ m,n ≤ 100
InputYou are given a template in which you need to implement a function whose signature is given below.C int findWordInAGrid(char grid[128][128], int m, int n, char word[...
Priyanka Sen
546
views
Priyanka Sen
asked
Sep 6, 2017
Puzzles
algorithms
+
–
1
votes
2
answers
1987
Asymptotic notations
g(n)=Ώ(n) h(n)=O(n) g(n) . h(n) =?
g(n)=Ώ(n)h(n)=O(n)g(n) . h(n) =?
VS
551
views
VS
asked
Sep 6, 2017
Algorithms
asymptotic-notation
algorithms
+
–
3
votes
3
answers
1988
Quick Sort
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a good article.
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a ...
Sourajit25
1.6k
views
Sourajit25
asked
Sep 3, 2017
Algorithms
algorithms
sorting
time-complexity
quick-sort
+
–
1
votes
1
answer
1989
True/False?
The depth of any DFS (Depth First Search) tree rooted at a vertex is at least as much as the depth of any BFS tree rooted at the same vertex. I think in line graph has the same depth in both DFS and BFS. So it may be false.
The depth of any DFS (Depth First Search) tree rooted at a vertex is at least as much as the depth of any BFS tree rooted at the same vertex.I think in line graph has the...
dileswar sahu
2.2k
views
dileswar sahu
asked
Sep 2, 2017
Algorithms
algorithms
graph-algorithms
true-false
+
–
1
votes
2
answers
1990
Algorithms
Solve this T(n) = 0.5T(n/2)+1 ; T(1)=1
Solve thisT(n) = 0.5T(n/2)+1 ; T(1)=1
Pavan Kumar Munnam
3.3k
views
Pavan Kumar Munnam
asked
Sep 1, 2017
Algorithms
algorithms
time-complexity
asymptotic-notation
+
–
0
votes
0
answers
1991
Interview
Have to find MAX of aj-ai in an array where j>=i+l in linear time.How to do it?My approach is to start j from l+1 to n and check min element every time is it a correct way to do it? when j = l+1 we check only 1st elemrent and for j = l+2 next 2 element and so on Is this approach is right?
Have to find MAX of aj-ai in an array where j>=i+l in linear time.How to do it?My approach is to start j from l+1 to n and check min element every time is it a correct wa...
Sayan Das 1
241
views
Sayan Das 1
asked
Aug 29, 2017
Algorithms
algorithms
data-structures
+
–
1
votes
3
answers
1992
Time Complexity of Iterative Program
The innermost loop will execute when j is multiple of i, and that will happen exactly i times. Please help me to find the time complexity of the below program:
The innermost loop will execute when j is multiple of i, and that will happen exactly i times. Please help me to find the time complexity of the below program:
Manu Thakur
2.9k
views
Manu Thakur
asked
Aug 29, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
0
votes
1
answer
1993
Analysis of Algorithms (Recurrences)
Consider the following recurrence. T(n) = T() + What is the value of recurrence? please explain in detail
Consider the following recurrence.T(n) = T() + What is the value of recurrence?please explain in detail
shashi111
522
views
shashi111
asked
Aug 27, 2017
Algorithms
algorithms
recurrence-relation
+
–
0
votes
1
answer
1994
dynamic programming
set2018
1.1k
views
set2018
asked
Aug 25, 2017
Algorithms
algorithms
dynamic-programming
+
–
1
votes
1
answer
1995
Asymptotic-Notations
Let f(n), g(n) & h(n) be 3 non-negative functions defined as follows: $f(n) = O(g(n))\; \; \; g(n) \neq O(f(n))$ $g(n) = O(h(n))\; \; \; h(n) = O(g(n))$ Which of the following is false? (A). f(n) + g(n) = O(h(n)) (B). f(n) = O(h(n)) (C). $h(n) \neq O(f(n))$ (D). $f(n).h(n) \neq O(g(n).h(n))$
Let f(n), g(n) & h(n) be 3 non-negative functions defined as follows:$f(n) = O(g(n))\; \; \; g(n) \neq O(f(n))$$g(n) = O(h(n))\; \; \; h(n) = O(g(n))$Which of the fol...
Victor0001
353
views
Victor0001
asked
Aug 23, 2017
Algorithms
algorithms
asymptotic-notation
+
–
1
votes
0
answers
1996
Asymptotic Notation
Let f(n), g(n) & h(n) be 3 non-negative functions defined as follows: $f(n) = O(g(n))\; \; \; g(n) \neq O(f(n))$ $g(n) = O(h(n))\: \: \: h(n) = O(g(n))$ Which of the following is false? (A). f(n) + g(n) = O(h(n)) (B). f(n) = O(h(n)) (C). $h(n) \neq O(f(n))$ (D). $f(n).h(n) \neq O(g(n).h(n))$
Let f(n), g(n) & h(n) be 3 non-negative functions defined as follows:$f(n) = O(g(n))\; \; \; g(n) \neq O(f(n))$$g(n) = O(h(n))\: \: \: h(n) = O(g(n))$Which of the followi...
Victor0001
1.3k
views
Victor0001
asked
Aug 23, 2017
Algorithms
asymptotic-notation
algorithms
+
–
7
votes
3
answers
1997
Self-doubt
Which of the following is exact recurrence relation for binary search (in terms of number of comparisons) ? 1. T(n) = 2T(n/2) + 1 2. T(n) = 2T(n/2) + 2 Please specify relevant reasons.
Which of the following is exact recurrence relation for binary search (in terms of number of comparisons) ?1. T(n) = 2T(n/2) + 12. T(n) = 2T(n/2) + 2Please specify releva...
just_bhavana
1.3k
views
just_bhavana
asked
Aug 22, 2017
Algorithms
algorithms
binary-search
+
–
3
votes
3
answers
1998
Sorted List
suppose there are 4 sorted lists of n/4 elements each. if we merge these list into a single sorted list of n elements, for the n=400 number of key comparisons in the worst case using an efficient algorithm is
suppose there are 4 sorted lists of n/4 elements each. if we merge these list into a single sorted list of n elements, for the n=400 number of key comparisons in the wors...
ABKUNDAN
5.7k
views
ABKUNDAN
asked
Aug 21, 2017
Algorithms
sorting
algorithms
+
–
0
votes
3
answers
1999
Solve this Q
Q. Consider the following functions. f (n) = 3 n + 100, n > 0 g (n) = n + log n, n > 0 Which of the following is correct for larger values of n? 1.f(n) = Ω(g(n)) and f(n) ≠ O (g(n)) 2. g(n) = O(f(n)) and f(n) ≠ Ω (g(n)) 3. f(n) = θ(g(n)) 4.None of these
Q. Consider the following functions.f (n) = 3 n + 100, n 0g (n) = n + log n, n 0Which of the following is correct for larger values of n?1.f(n) = Ω(g(n)) and f(n) ≠ ...
kallu singh
1.7k
views
kallu singh
asked
Aug 20, 2017
Algorithms
algorithms
asymptotic-notation
normal
+
–
0
votes
1
answer
2000
DFS back edge
If a directed graph G is cyclic but can be made acyclic by removing 1 edge then a DFS will encounter exactly 1 Backedge. True or false ?
If a directed graph G is cyclic but can be made acyclic by removing 1 edge then a DFS will encounter exactly 1 Backedge. True or false ?
Xylene
2.5k
views
Xylene
asked
Aug 20, 2017
Programming in C
depth-first-search
algorithms
graph-algorithms
+
–
1
votes
1
answer
2001
Please solve this Q
Q. The best case of quick sort helps Aditya to sort a particular data set of size ‘n’ in 640 ms. Suresh also tried the same algorithm on similar data set and it took him 256 ms in best case to sort a file of size 16. What could be Aditya’s file size?
Q. The best case of quick sort helps Aditya to sort a particular data set of size ‘n’ in 640 ms. Suresh also tried the same algorithm on similar data set and it took...
kallu singh
996
views
kallu singh
asked
Aug 19, 2017
Algorithms
algorithms
quick-sort
+
–
0
votes
1
answer
2002
Please solve this Q
What is the time complexity to construct a binary tree when inorder and preorder traversal of the tree is given? 1. O(n) 2.O(n log n) 3. O(n2) 4.O(n2 log n)
What is the time complexity to construct a binary tree when inorder and preorder traversal of the tree is given?1. O(n)2.O(n log n)3. O(n2)4.O(n2 log n)
kallu singh
246
views
kallu singh
asked
Aug 19, 2017
Algorithms
algorithms
+
–
1
votes
0
answers
2003
What is Aggregate Analysis? Where to use it? How to use it?
bhuv
418
views
bhuv
asked
Aug 18, 2017
Algorithms
algorithms
aggregate-analysis
+
–
3
votes
1
answer
2004
Time Complexity
Is the answer D ?
Is the answer D ?
Pranjali1894
653
views
Pranjali1894
asked
Aug 18, 2017
Algorithms
algorithms
time-complexity
test-series
+
–
2
votes
2
answers
2005
Optimal Merge Pattern,similar to http://gateoverflow.in/1997/gate2014-2-38
To merge 2 files of size m and n it takes m + n time What will be the optimal time Complexity to merge the files of size 10, 15, 40, 70, 75 and 80?
To merge 2 files of size m and n it takes m + n time What will be the optimal time Complexity to merge the files of size 10, 15, 40, 70, 75 and 80?
Ali Jazib Mahmood
1.4k
views
Ali Jazib Mahmood
asked
Aug 18, 2017
Algorithms
algorithms
merging
numerical-answers
+
–
2
votes
1
answer
2006
Coreman: Time Complexity
Can you please solve this following question further? What will be the time complexity?
Can you please solve this following question further?What will be the time complexity?
Manu Thakur
1.4k
views
Manu Thakur
asked
Aug 18, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
cormen
recurrence-relation
+
–
0
votes
0
answers
2007
Algorithm
Beyonder
300
views
Beyonder
asked
Aug 18, 2017
Algorithms
algorithms
dijkstras-algorithm
breadth-first-search
+
–
1
votes
0
answers
2008
Please solve this Q
Q. Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j} g is given by the entry Wij in the matrix WThe largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the edge with weight x is ________ Note : This question was asked as Numerical Answer Type. A) 8 B) 12 C) 10 D) 11
Q. Consider the weighted undirected graph with 4 vertices, where the weight of edge {i, j} g is given by the entry Wij in the matrix WThe largest possible integer value ...
kallu singh
415
views
kallu singh
asked
Aug 17, 2017
Algorithms
algorithms
graph-theory
+
–
2
votes
1
answer
2009
master theorem
explain complexity for this
explain complexity for this
set2018
4.1k
views
set2018
asked
Aug 17, 2017
Algorithms
algorithms
master-theorem
time-complexity
+
–
1
votes
1
answer
2010
master theorem
is the time complexity for this fuction is O(n)?
is the time complexity for this fuction is O(n)?
set2018
633
views
set2018
asked
Aug 17, 2017
Algorithms
algorithms
master-theorem
time-complexity
+
–
Page:
« prev
1
...
62
63
64
65
66
67
68
69
70
71
72
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register