Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
1
votes
1
answer
1891
Strongly connected graph verification via BFS
Hi Guys, DFS could be used for finding directed graph is strongly connected or not. But could we use BFS also ? Please share your valuable opinion. ping @Kushagra Chatterjee, @Soumya29, @srestha, @Subarna Das and @VS ji.
Hi Guys,DFS could be used for finding directed graph is strongly connected or not. But could we use BFS also ? Please share your valuable opinion.ping @Kushagra Chatterje...
Chhotu
1.8k
views
Chhotu
asked
Nov 4, 2017
Algorithms
algorithms
graph-algorithms
descriptive
+
–
2
votes
3
answers
1892
mock test
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Given a queue of size n in which we have to put all n elements in increasing order. What will be the time complexity of the best known algorithm?
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and th...
chandra sai
2.9k
views
chandra sai
asked
Nov 4, 2017
DS
stack
algorithms
data-structures
+
–
0
votes
1
answer
1893
self doubt apply
can masters theorem be used when base condition is given in a recurrence ? can we directly apply masters theorem to any recurrence ?
can masters theorem be used when base condition is given in a recurrence ?can we directly apply masters theorem to any recurrence ?
Venkat Sai
361
views
Venkat Sai
asked
Nov 3, 2017
Algorithms
algorithms
master-theorem
+
–
2
votes
0
answers
1894
Bellman Ford Algorithm (Edge sequence and convergence of algo.)
Hi Guys, As everyone knows Bellman Ford Algorithm works on DP approach. The algorithm calculate shortest paths in bottom-up manner. It first calculates the shortest distances which have at-most one edge in the path. Then, ... is your opinion ? Refer --> http://www.geeksforgeeks.org/dynamic-programming-set-23-bellman-ford-algorithm/
Hi Guys,As everyone knows Bellman Ford Algorithm works on DP approach. The algorithm calculate shortest paths in bottom-up manner. It first calculates the shortest distan...
Chhotu
867
views
Chhotu
asked
Nov 3, 2017
Algorithms
algorithms
shortest-path
bellman-ford
graph-algorithms
+
–
2
votes
1
answer
1895
time complexity
operation on the list in this order O(sqrt n)insert,O(nlog n) decrease key ,O(n) find operations. What is the time complexity of all these operations put together ?
operation on the list in this order O(sqrt n)insert,O(nlog n) decrease key ,O(n) find operations. What is the time complexity of all these operations put together ?
mohitbawankar
361
views
mohitbawankar
asked
Nov 2, 2017
Algorithms
algorithms
time-complexity
+
–
5
votes
1
answer
1896
In-place Merge Sort via Doubly linked list in place of Array
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our merge procedure will take O($n^2$) time. so overall ... list in place of Array (for storing and merging data) ? Please share your valuable opinion. It will be great help.
In general merge sort is not considered in-place sorting technique. Because an auxiliary array is used. If we will try to do it in-place in array data structure then our ...
Chhotu
1.4k
views
Chhotu
asked
Nov 2, 2017
Algorithms
algorithms
sorting
space-complexity
linked-list
time-complexity
+
–
5
votes
2
answers
1897
Time Complexity
Consider the following function Void func(int n){ Int k=n; Int i=0; for(;i<n;i++){ while(k>1){ k>>=1; } } What is the worst case time complexity of the function?
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?
shaurya vardhan
1.7k
views
shaurya vardhan
asked
Nov 2, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
recursion
programming-in-c
+
–
4
votes
1
answer
1898
Time Complexity
Consider the following code….. Search(int n){ if(n<2) then return; else{ s=0; for(i=1;i<=8;i++){ Search(n/2); } for(i=1;i<n*n;i++){ for(j=1;j<n;j=j*2){ s=s+i; } } } } Assume s is a global variable.Find the complexity of the given Search(n)?
Consider the following code…..Search(int n){if(n<2)then return; else{s=0;for(i=1;i<=8;i++){Search(n/2);}for(i=1;i<n*n;i++){for(j=1;j<n;j=j*2){s=s+i;}}}}Assume s is a gl...
shaurya vardhan
665
views
shaurya vardhan
asked
Nov 2, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
recursion
programming-in-c
+
–
3
votes
0
answers
1899
Shortest Path
First Statement is true. But I don't know about second?
First Statement is true. But I don't know about second?
Shivam Chauhan
914
views
Shivam Chauhan
asked
Nov 2, 2017
Algorithms
shortest-path
algorithms
+
–
1
votes
0
answers
1900
MST Kruskal
First statement is False because complexity will be O(E2). I think the second statement is true? But not sure
First statement is False because complexity will be O(E2).I think the second statement is true? But not sure
Shivam Chauhan
755
views
Shivam Chauhan
asked
Nov 2, 2017
Algorithms
algorithms
minimum-spanning-tree
time-complexity
prims-algorithm
+
–
2
votes
1
answer
1901
algorithm
Suppose A is sorted array and some of the elements are duplicates what is the best upper bound to find out the number of elements that are equal to any given key 'k'.
Suppose A is sorted array and some of the elements are duplicates what is the best upper bound to find out the number of elements that are equal to any given key 'k'.
Kaluti
875
views
Kaluti
asked
Nov 1, 2017
Algorithms
algorithms
sorting
+
–
5
votes
1
answer
1902
Testbook Test Series
jaig
558
views
jaig
asked
Nov 1, 2017
Algorithms
algorithms
time-complexity
recurrence-relation
+
–
2
votes
0
answers
1903
Testbook Test Series
Assume there are 1024 men,each with distinct arm strength,in an arm wrestling match stronger arm always wins.Number of arm wrestling matches required to find men with strongest and second strongest arm in worst case is ______. I got right for the strongest ... one who fought with the strongest one in the last match? Answer says for second strongest it will be 9 matches more.
Assume there are 1024 men,each with distinct arm strength,in an arm wrestling match stronger arm always wins.Number of arm wrestling matches required to find men with str...
jaig
460
views
jaig
asked
Nov 1, 2017
Algorithms
algorithms
numerical-answers
+
–
3
votes
1
answer
1904
Trees
Number of rooted labeled trees(i.e. each node can be the root) with 6 vertices is:
Number of rooted labeled trees(i.e. each node can be the root) with 6 vertices is:
Shivam Chauhan
1.1k
views
Shivam Chauhan
asked
Nov 1, 2017
Programming in C
binary-tree
algorithms
+
–
3
votes
2
answers
1905
MadeEasy Subject Test: Algorithms - Graph Algorithms
Consider vertices V1 and V2 that are simultaneously on function call stack at some point during DFS from vertex s. Which of the following are always true for this digraph ? 1. There exists a directed path from s to V1 and s to ... only statement 3 is correct......How can we say that statement 1 is also correct please someone explain the reason
Consider vertices V1 and V2 that are simultaneously on function call stack at some point during DFS from vertex s.Which of the following are always true for this digraph ...
Shivi rao
843
views
Shivi rao
asked
Oct 31, 2017
Algorithms
made-easy-test-series
algorithms
graph-algorithms
+
–
1
votes
1
answer
1906
Fibonacci-Sequence
Which of the following is true about time complexity for generating $\color{blue} {n^{th}}$ Fibonacci number ? a)$O(n)$ b)$O(Logn)$ c)$O(2^n)$ d)$\Omega(n)$
Which of the following is true about time complexity for generating $\color{blue} {n^{th}}$ Fibonacci number ? a)$O(n)$b)$O(Logn)$c)$O(2^n)$d)$\Omega(n)$
Prabhanjan_1
1.8k
views
Prabhanjan_1
asked
Oct 30, 2017
Algorithms
algorithms
time-complexity
+
–
0
votes
1
answer
1907
Knapsack problem
5.Consider the Knapsack instance with 5 objects and a capacity M=11, profit P=(5,4,7,2,3) and weight W=(4,3,6,2,2.). Solve it using dynamic programming approach.
5.Consider the Knapsack instance with 5 objects and a capacity M=11, profit P=(5,4,7,2,3) andweight W=(4,3,6,2,2.). Solve it using dynamic programming approach.
Syedabbas110
2.8k
views
Syedabbas110
asked
Oct 30, 2017
Algorithms
algorithms
knapsack-problem
dynamic-programming
+
–
1
votes
0
answers
1908
Prim's algorithm for MST
Assuming that the graph can contain repeated edge weights, we have a single tree at any instance when applying Prim's algorithm. Justify this statement.
Assuming that the graph can contain repeated edge weights, we have a single tree at any instance when applying Prim's algorithm.Justify this statement.
just_bhavana
850
views
just_bhavana
asked
Oct 30, 2017
Algorithms
prims-algorithm
algorithms
+
–
1
votes
1
answer
1909
Asymptotic
which is asymptotically greater n or $2^{logn}$
which is asymptotically greater n or $2^{logn}$
learner_geek
303
views
learner_geek
asked
Oct 30, 2017
Algorithms
algorithms
asymptotic-notation
+
–
2
votes
1
answer
1910
Finding Minimum
.........
.........
junaid ahmad
315
views
junaid ahmad
asked
Oct 29, 2017
Algorithms
algorithms
binary-search
time-complexity
numerical-answers
test-series
+
–
2
votes
1
answer
1911
Kruskal
Can Anyone provide all the data structure that we can used and time complexity that we get for Kruskal algorithm of finding the minimum spanning tree.
Can Anyone provide all the data structure that we can used and time complexity that we get for Kruskal algorithm of finding the minimum spanning tree.
junaid ahmad
543
views
junaid ahmad
asked
Oct 29, 2017
Algorithms
algorithms
minimum-spanning-tree
+
–
1
votes
1
answer
1912
I have a basic question regarding DAA
let a function f(x) =$n^3$+$n^4$+1 so which are true 1. θ($n^4$) 2. θ($n^5$) 3. θ(1) 4. θ($n^3$) 5. Ω ($n^4$) 6. Ω ($n^5$) 7. Ω (1) 8. Ω ($n^3$) 9. O ($n^4$) 10. O ($n^5$) 11. O (1) 12. O ($n^3$) PLZ GIVE EXPLANATION WHICH ONE IS TRUE OR FALSE.
let a functionf(x) =$n^3$+$n^4$+1so which are true1. θ($n^4$)2. θ($n^5$)3. θ(1)4. θ($n^3$)5. Ω ($n^4$)6. Ω ($n^5$)7. Ω (1)8. Ω ($n^3$)9. O ($n^4$)10. O ($n^5$)11....
hem chandra joshi
360
views
hem chandra joshi
asked
Oct 29, 2017
Algorithms
algorithms
asymptotic-notation
+
–
5
votes
0
answers
1913
Time Complexity
//n is a prime number here int main() { for(i=1;i<=n;i=2*i) { for(j=1;j<=n;j++) { if(n%i==0) { k=1; while(k<=n) { a=b+c; k=k+1; } } } } }
//n is a prime number hereint main() { for(i=1;i<=n;i=2*i) { for(j=1;j<=n;j++) { if(n%i==0) { k=1; while(k<=n) { a=b+c; k=k+1; } } } } }
junaid ahmad
1.1k
views
junaid ahmad
asked
Oct 28, 2017
Algorithms
time-complexity
algorithms
+
–
0
votes
0
answers
1914
MERGE SORT
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the list we have to take 5-5 elements from bottom to up for merging. if I am wrong please let me correct!
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the...
learner_geek
604
views
learner_geek
asked
Oct 28, 2017
Algorithms
merge-sort
algorithms
sorting
time-complexity
+
–
1
votes
0
answers
1915
Algorithm
True or False Explain Bellman Ford can never find shortest path of a graph Floyd Warshall can find shortest path of a graph
True or False ExplainBellman Ford can never find shortest path of a graphFloyd Warshall can find shortest path of a graph
srestha
344
views
srestha
asked
Oct 28, 2017
Algorithms
algorithms
+
–
0
votes
0
answers
1916
#doubt algo
What is the disadvantage of avl tree over b tree ??
What is the disadvantage of avl tree over b tree ??
air1ankit
193
views
air1ankit
asked
Oct 28, 2017
Algorithms
algorithms
databases
+
–
0
votes
1
answer
1917
DFS: Practice Exercise
Q1. Consider the following DFS algorithm for cycle detection in a graph. DFS(G) for each vertex u Belongs G.V u.color = WHITE U.pi = NIL time = 0 for each vertex u Belongs G.V if u.color == WHITE DFS-VISIT(G , u) DFS-VISIT(G, u) time = ... DFS tree if we draw an edge from one leaf node to another leaf node then that edge is called cross edge. Is this statement is true ??
Q1. Consider the following DFS algorithm for cycle detection in a graph.DFS(G) for each vertex u Belongs G.V u.color = WHITE U.pi = NIL time = 0 for each vertex u Belongs...
Shubhanshu
583
views
Shubhanshu
asked
Oct 28, 2017
Algorithms
algorithms
graph-algorithms
depth-first-search
+
–
0
votes
0
answers
1918
Most efficient data structure to implement Sets of Integer and what is the complexity of operation......
Most efficient data structure to implement Sets of Integer and what is the complexity of operationinsert(int e),delete(int e),isMember(int e) : returns TRUE if member oth...
Rohit Gupta 8
1.1k
views
Rohit Gupta 8
asked
Oct 27, 2017
DS
algorithms
data-structures
set-theory
+
–
3
votes
1
answer
1919
Tower of Hanoi
In Tower of Hanoi problem, when we move 3 disk , it will rotate like Input : 3 Output : Disk 1 moved from A to C Disk 2 moved from A to B Disk 1 moved from C to B Disk 3 moved from A to C Disk 1 moved from B to A Disk 2 moved from ... www.cs.cmu.edu/~cburch/survey/recurse/hanoiex.html Some disk move I have shown here with recursion tree. Plz help me some moves of disk after this move
In Tower of Hanoi problem, when we move 3 disk , it will rotate likeInput : 3 Output : Disk 1 moved from A to C Disk 2 moved from A to B Disk 1 moved from C to B Disk 3 m...
srestha
2.5k
views
srestha
asked
Oct 26, 2017
DS
recursion
algorithms
towers-of-hanoi
+
–
0
votes
0
answers
1920
Algorithm
1. What is the time complexity to design BST from given postorder and inorder traversal? 2. What is the time complexity to design BST from given postorder only. I know time to design BST from Preorder is O(n).
1. What is the time complexity to design BST from given postorder and inorder traversal?2. What is the time complexity to design BST from given postorder only. I know tim...
Anu007
443
views
Anu007
asked
Oct 24, 2017
Algorithms
algorithms
tree-traversal
+
–
Page:
« prev
1
...
59
60
61
62
63
64
65
66
67
68
69
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register