excercise
-
[Introduction to Algorithms, CLRS] Exercises 2.2-1알고리즘 2017. 11. 25. 20:06
This is a solution for Introduction to Algorithms. I write this for my study purpose. Exercises 2.2-1 Express the function n3 / 1000 - 100n2 - 100n + 3 in terms of Θ notation. Answer: The answer’s going to be Θ(n^3). (n to the 3) Writing e for the original expression, Θ(e) = Θ(max(n^3/1000, −100n^2, −100n, 3)). This will equal to Θ(max(n^3 , n^2 , n, 1)). As Θ(1) < Θ(n) < Θ(n^2 ) < Θ(n^3 ), Θ(ma..
-
[Introduction to Algorithms, CLRS] Exercises 2.1-4알고리즘 2017. 11. 25. 17:10
This is a solution for Introduction to Algorithms. I write this for my study purpose. Exercises 2.1-4 Consider the problem of adding two n-bit binary integers, stored in two n-element arrays A and B. The sum of the two integers should be stored in binary form in an (n+1)-element array C . State the problem formally and write pseudocode for adding the two integers. Answer: - Problem: Input: Two n..