I am trying to solve an unbalanced recursion tree problem.
Here is the question:
T(n) = T(n/3) + T(2n/5) + n^3
I tried drawing the tree, but I am stuck on solving the problem. Can anyone help me?
Thanks.
We know that order of this recursion is at least n^3 because any step use n^3. And also we know that T(n)<= 2T(2n/5)+n^3 and solution of this recursion by master theorem is o(n^3). and finally we conclude that T(n)=theta(n^3)
Related
I'm a newbie in DSA and I just realized that all of the DP problems have recursive solutions. By the way I was wondering if there can be always a dp solution for all of recursive problems? if so, then why don't we give up on divide and conquer and just use dp?
My idea is to start using lp solve in order to solve a linear programming model. As a result, I studied the lp function and his components.
However, one thing which is not clear to me is how do I display all possible optimal solutions using lp solve in R without my variables be binary?
I would appreciate an easy example to better understand.
Thanks,
David
Can someone provide a derivation of the equation he gets on 1:15 using quotient rule https://www.youtube.com/watch?v=aVId8KMsdUU&index=18&list=LL2gry7n2BsijUeah-oFnPSg
Pretty simple question, but I get another equation, so I'm stuck.
Thanks in advance.
Your question probably belongs on math.stackexchange.com though.
Since i am new to graph, i am not getting algorithm that can can clearly explain how to find articulation point in graph. Please anyone explain? thanx in advance
A simple algorithm:
For each Node N so:
1. Take it away
2. Count the number of connected components. Either by dfs or bfs.
If that's still one, continue with the loop. If it is two, you have found an articulation point. Mark and continue with the loop.
This will run in quadratic time. Not sure whether there is a better algorithm.
Edit: i found some java source code on this site: http://algs4.cs.princeton.edu/41undirected/Biconnected.java.html
Refer to this explanation. I hope you would find it useful.
http://www.geeksforgeeks.org/articulation-points-or-cut-vertices-in-a-graph/
I can't really seem to grasp what it really means to say a problem is NP-Complete. Could anyone help me with the following question?
An NP-complete problem is a problem for which one can prove that an algorithm for solving it in polynomial time does not exist. Is the statement true?
I would want to say this statement isn't true, because can anyone actually prove that such an algorithm doesn't exist for any NP-Complete problem? From looking around on various sources, I understand that no polynomial time algorithm is known for any NP-Complete problem; however, it can't be proven.
Any help would be greatly appreciated. Thanks.
It is possible in some situations to prove that no algorithm exists that is better than a certain limit.
For example the O(n log n) bound for a comparison sort has been proven. No matter how clever we become in the future, we can be sure that no-one will ever invent an O(n) comparison sort.
In this case though, no-one has found a proof. But that doesn't mean it can't be proven.
The statement is more fundamentally wrong: There are problems that cannot be solved in polynomial time which are much harder than NP problems. The point of NP completeness is a polynomial time solution existing is equivalent to P=NP (which means additionally that a solution not existing means P!=NP).