The input size of a certain algorithm is n^2+n*m. Its running time is O(m*n^3). Can the running time be considered polynomial in the input size?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Run time T(n,m) is said to be polynomial in the input size S(n,m) = n^2+n*m if there is a polynomial in S that is an upper bound on T(n,m).
Consider the polynomial S^2(n,m) = (n^2+n*m)^2 = n^4 + 2(n^2)n*m + (n^2)(m^2). Since n^4 and (n^2)(m^2) are squares of positive integers they are positive, so S^2(n,m) > 2(n^2)n*m > n^3 * m.
Since T(n,m) is O(n^3 * m) and S^2(n,m) > n^3 * m we have T(n,m) is O(S^2(n,m)) hence run time is bounded by a polynomial in input size.