Question: Remember your factoring algorithms must input a number and then print its prime factors. For instance, if the input is 315, then the output should

Remember your factoring algorithms must input a number and then print its prime factors. For instance, if the input is 315, then the output should be "3 3 5 7" in any order. 4. You remember an algorithm for factoring a number X: First, divide out all of the factors of two, then three, then four, then five, etc. Lastly, divide out all of the factors of X. a. Write some pseudo-code for such an algorithm, making sure to print out the prime factors. b. Assuming it takes unit time to do the subtractions, additions, multiplications, and divisions, how fast is such an algorithm, in order notation, as a function of X? Remember your factoring algorithms must input a number and then print its prime factors. For instance, if the input is 315, then the output should be "3 3 5 7" in any order. 4. You remember an algorithm for factoring a number X: First, divide out all of the factors of two, then three, then four, then five, etc. Lastly, divide out all of the factors of X. a. Write some pseudo-code for such an algorithm, making sure to print out the prime factors. b. Assuming it takes unit time to do the subtractions, additions, multiplications, and divisions, how fast is such an algorithm, in order notation, as a function of X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
