Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
0
votes
0
answers
1921
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
444
views
Anu007
asked
Oct 24, 2017
Algorithms
algorithms
tree-traversal
+
–
4
votes
1
answer
1922
AceTest Series: Algorithms - Time Complexity
for (i=n ; i>0 ; i--) { for ( j=1;j<n ; j=j*2) { for ( k=0;k<j ;k++) { } } } time complexity ?? how to find of inner and innermost loop?
for (i=n ; i>0 ; i ) { for ( j=1;j<n ; j=j*2) { for ( k=0;k<j ;k++) { } } }time complexity ??how to find of inner and innermost loop?
aaru14
1.1k
views
aaru14
asked
Oct 23, 2017
Algorithms
ace-test-series
algorithms
time-complexity
+
–
4
votes
1
answer
1923
What can be the big oh?
What will be the Big Oh for $n!$ ? As we can deduce log($n!$) = O(log n) . Is there any proof like we have for log($n!$) ?
What will be the Big Oh for $n!$ ?As we can deduce log($n!$) = O(log n) .Is there any proof like we have for log($n!$) ?
Manish Chetwani
376
views
Manish Chetwani
asked
Oct 23, 2017
Algorithms
asymptotic-notation
algorithms
+
–
2
votes
1
answer
1924
CLR 3rd Edition page no. 42 Q.n. c
Wha is the relationship between the running time of insertion sort and the number of inversions in the input array ? Is the circled text should be greater instead of less .Plz justify . PS: This image has been taken from solun manual of CLR.
Wha is the relationship between the running time of insertion sort and the number of inversions in the input array ?Is the circled text should be greater instead of less ...
dragonball
1.2k
views
dragonball
asked
Oct 21, 2017
Algorithms
algorithms
array
time-complexity
+
–
3
votes
0
answers
1925
DFS: certain nodes not pushed to the stack.
Which of the following are true:- 1. DFS continues to visited first unvisited successor of each node as long as possible. 2. Certain nodes are pushed into the stack. 3. DFS first visits all the immediate successors of a node before moving to their ... nodes are pushed into the stack. 3. False -- this happens in BFS not in DFS. 4. True -- Iterative DFS.
Which of the following are true:-1. DFS continues to visited first unvisited successor of each node as long as possible.2. Certain nodes are pushed into the stack.3. DFS ...
Shubhanshu
745
views
Shubhanshu
asked
Oct 20, 2017
Algorithms
algorithms
depth-first-search
graph-algorithms
data-structures
+
–
1
votes
2
answers
1926
Self Doubt
What will be the time complexity of A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=(i^2);j++) { for(k=1;k<=(n/2);k++) { printf("ABCD"); } } } }
What will be the time complexity of A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=(i^2);j++) { for(k=1;k<=(n/2);k++) { printf("ABCD"); } } } }
Manish Chetwani
561
views
Manish Chetwani
asked
Oct 20, 2017
Algorithms
algorithms
time-complexity
+
–
1
votes
1
answer
1927
Self Doubt
What will be the time complexity of the following code? A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { for(k=1;k<=100;k++) { printf("ABCD"); } } } }
What will be the time complexity of the following code?A() { int i,j,k,n; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { for(k=1;k<=100;k++) { printf("ABCD"); } } } }
Manish Chetwani
339
views
Manish Chetwani
asked
Oct 20, 2017
Algorithms
time-complexity
algorithms
+
–
2
votes
1
answer
1928
Algo:- Nuts and bolts
rahul sharma 5
937
views
rahul sharma 5
asked
Oct 18, 2017
Algorithms
algorithms
time-complexity
made-easy-test-series
+
–
5
votes
1
answer
1929
Algo: Time complexity
T(n) = 4T(n/2) + n2.$\sqrt{2}$ In thetha notation?
T(n) = 4T(n/2) + n2.$\sqrt{2}$In thetha notation?
rahul sharma 5
713
views
rahul sharma 5
asked
Oct 18, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
4
votes
1
answer
1930
Modified form of GATE1996_2.15
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivot i) 1,2,3,…n ii) n,n−1,n−2,…,2,1 Let S1 and S2 be the number of swaps made for the inputs (i) and (ii) respectively. Then, i) How is S1 and S2 related ? ii) How will the answer change if the pivot is changed to middle element ?
Quick-sort is run on two inputs shown below to sort in ascending order taking first element as pivoti) 1,2,3,…nii) n,n−1,n−2,…,2,1Let S1 and S2 be the number of s...
rishi71662data4
973
views
rishi71662data4
asked
Oct 18, 2017
Algorithms
algorithms
data-structures
sorting
quick-sort
+
–
0
votes
0
answers
1931
Data Structure: Find 7th smallest element in Min heap
In a binary min heap with n elements, the 7th smallest element can be found in _____ ? Answer given is O(logn) and solution:- Delete the 1st smallest element O(logn) Delete the 2nd smallest element O(logn) .... ... this solution the data arrangement of the heap will be changed after performing these operation. any better solution than this???
In a binary min heap with n elements, the 7th smallest element can be found in _____ ?Answer given is O(logn) and solution:-Delete the 1st smallest element O(logn)Delete ...
Shubhanshu
1.5k
views
Shubhanshu
asked
Oct 18, 2017
Programming in C
binary-heap
time-complexity
algorithms
+
–
1
votes
1
answer
1932
Solution of Hackerrank problem
Below 2 codes are given, the code is printing the total number of matching pairs in a given array. Example: if n=9; & the array values are: 10 20 20 10 10 30 50 10 20 Output: 3 Explanation: (10,10) (20,20) (10,10) total 3 matching pairs. There is a ... if(sock[i] == sock[i+1]) pairs++, i++; cout << pairs << endl; return 0; } Explain the difference...
Below 2 codes are given, the code is printing the total number of matching pairs in a given array.Example:if n=9;& the array values are: 10 20 20 10 10 30 50 10 20Output:...
Naveen Kumar 3
884
views
Naveen Kumar 3
asked
Oct 16, 2017
Programming in C
algorithms
programming-in-c
+
–
0
votes
0
answers
1933
Time complexity
dragonball
594
views
dragonball
asked
Oct 15, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
bad-question
+
–
1
votes
1
answer
1934
Master Theorem
dragonball
530
views
dragonball
asked
Oct 15, 2017
Algorithms
algorithms
master-theorem
time-complexity
test-series
+
–
3
votes
0
answers
1935
Self Doubt ( Decrease key operation )
While going through dijkstra's algorithm, there is a term "decrease key". I am not getting the meaning when it says "we do decrease key operation". What exactly we do and what is the meaning of decrease key ?
While going through dijkstra's algorithm, there is a term "decrease key". I am not getting the meaning when it says "we do decrease key operation". What exactly we do and...
Hitoshi
1.7k
views
Hitoshi
asked
Oct 15, 2017
Algorithms
algorithms
dijkstras-algorithm
graph-theory
+
–
2
votes
1
answer
1936
Asymptotic time order
dragonball
888
views
dragonball
asked
Oct 15, 2017
Algorithms
algorithms
asymptotic-notation
test-series
+
–
0
votes
0
answers
1937
Spanning Tree
dragonball
420
views
dragonball
asked
Oct 15, 2017
Algorithms
algorithms
minimum-spanning-tree
+
–
1
votes
2
answers
1938
Algo doubt
iterated logarithmic function is defined as $\log^*n = \begin{cases} 0 &\text{if }\quad n\leq 0 \\1 +\log^*(\log n) &\text{if } \quad n >1\end{cases}$ Which of the following is true? $\log^*n = O(\log(\log n ))$ $(\log^*n)!= O(\log n)$ $\log^* n = \Theta(\log n)$ $(\log^*n)^n= O((\log n)!)$
iterated logarithmic function is defined as$\log^*n = \begin{cases} 0 &\text{if }\quad n\leq 0 \\1 +\log^*(\log n) &\text{if } \quad n >1\end{cases}$Which of the followi...
Surya Dhanraj
806
views
Surya Dhanraj
asked
Oct 15, 2017
Algorithms
algorithms
asymptotic-notation
logarithmic-function
multiple-selects
+
–
4
votes
1
answer
1939
Merge sort
True or False Merge sort on Linked list takes O(nlogn)
True or FalseMerge sort on Linked list takes O(nlogn)
Shivi rao
1.6k
views
Shivi rao
asked
Oct 10, 2017
DS
merge-sort
algorithms
sorting
time-complexity
+
–
2
votes
1
answer
1940
priority based scheduling
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority based scheduling is a)O(n) b)O(logn) c)O(nlogn) d)O(1)
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority ...
A_i_$_h
1.2k
views
A_i_$_h
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
job-scheduling
+
–
3
votes
1
answer
1941
Time complexity
Solve the following recurrence relation $T(n)=4T(n/2)+n^2 \sqrt 2$
Solve the following recurrence relation$T(n)=4T(n/2)+n^2 \sqrt 2$
Shivi rao
771
views
Shivi rao
asked
Oct 9, 2017
Algorithms
time-complexity
algorithms
asymptotic-notation
+
–
2
votes
2
answers
1942
CLRS Divide-and-Conquer Strassens's algorithm
Do we need to study the Strassens's algorithm in detail like proof or working of that algorithm or we just need to know the time complexity of the algorithm because I can't find it's explanation anywhere?
Do we need to study the Strassens's algorithm in detail like proof or working of that algorithm or we just need to know the time complexity of the algorithm because I can...
Manasi Srivastava
886
views
Manasi Srivastava
asked
Oct 9, 2017
Algorithms
algorithms
divide-and-conquer
dynamic-programming
+
–
1
votes
0
answers
1943
General Doubt Regarding Calculating Algorithm Complexity
While going through some solutions of calculating algorithm complexity, i came across this statement $\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + ........ + \frac{1}{n} = logn$ For example this is one question ... and Log (1) = 0, even basis is not true. Let me know what i am missing, and is this the correct expansion of log n
While going through some solutions of calculating algorithm complexity, i came across this statement$\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + ........ + \f...
stblue
300
views
stblue
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
+
–
2
votes
1
answer
1944
Test series
An array ‘A’ of length n contains numbers {0, 1, 2}, numbers are present in array in arbitrary order. The best sorting algorithms, takes 250 units of time when n = 100. If n = 450. The minimum time required by algorithm on same hardware __________ (Rounded off to integers).
An array ‘A’ of length n contains numbers {0, 1, 2}, numbers are present in array in arbitrary order.The best sorting algorithms, takes 250 units of time when n = 100...
Shivi rao
491
views
Shivi rao
asked
Oct 9, 2017
Algorithms
test-series
algorithms
sorting
time-complexity
+
–
3
votes
1
answer
1945
Time complexity
f(n)=Ω(n),g(n)=O(n) than what is f(n).g(n)
f(n)=Ω(n),g(n)=O(n) than what is f(n).g(n)
Shivi rao
393
views
Shivi rao
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
asymptotic-notation
+
–
3
votes
1
answer
1946
CMI Question
Selection of the kth smallest element in a set of n elements. O(n) O(n^2). Reason.
Selection of the kth smallest element in a set of n elements.O(n)O(n^2).Reason.
Krishna Madhav
359
views
Krishna Madhav
asked
Oct 9, 2017
Algorithms
algorithms
time-complexity
+
–
4
votes
4
answers
1947
Ace Test Series: Algorithms - Sorting
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is (A) (n log n) / 2 (B) n lon n - n + 1 (C) n log n (D) n log n + n
Consider bottom-up merge sort working on 'n' elements. Assume 'n' is a power of 2. The minimum number of comparisons in order to get sorted list is(A) (n log n) / 2(B) n ...
Aibi
2.6k
views
Aibi
asked
Oct 8, 2017
Algorithms
merge-sort
ace-test-series
sorting
algorithms
+
–
1
votes
1
answer
1948
Algo:- BFS
If in a given graph all edge weights are equal and negative then BFS will correctly find out single source shortest path to all vertices,starting from vertex v? True/False?
If in a given graph all edge weights are equal and negative then BFS will correctly find out single source shortest path to all vertices,starting from vertex v? True/Fals...
rahul sharma 5
668
views
rahul sharma 5
asked
Oct 4, 2017
Algorithms
algorithms
graph-algorithms
true-false
+
–
1
votes
2
answers
1949
algorithm
.Let S1= ∑nr/2r (r=0 to logn-1) .S2= ∑r2r (r=0 to logn-1) what will be s1 and and s2 after expension
.Let S1= ∑nr/2r (r=0 to logn-1) .S2= ∑r2r (r=0 to logn-1)what will be s1 and and s2 after expension
eyeamgj
1.7k
views
eyeamgj
asked
Oct 4, 2017
Algorithms
algorithms
recurrence-relation
descriptive
+
–
5
votes
5
answers
1950
Matrix Chain
Total no. of ways to perform matrix multiplication having 7 matrices is ? Total no. of ways to by which we could parenthesize 7 matrices is ? Does the above two questions are different or same ? Plz explain the answer.
Total no. of ways to perform matrix multiplication having 7 matrices is ?Total no. of ways to by which we could parenthesize 7 matrices is ?Does the above two questions ...
dragonball
15.5k
views
dragonball
asked
Oct 1, 2017
Algorithms
algorithms
dynamic-programming
+
–
Page:
« prev
1
...
60
61
62
63
64
65
66
67
68
69
70
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register