Option #1: Program 3 (Exercise #5)

Implement the algorithm outlined in Exercise # 5 (Chapter 7 of Carrano & Henry, 2015, p. 227) in Java pseudocode. Analyze your algorithm in Big-Oh notation and provide the appropriate analysis.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Ensure that your program has the required class and a test class. Compile and submit Exercise 5, the Big-Oh evaluations, and screenshots of your program’s execution and output in a single document. Also attach all appropriate source code in a zip file.

Carrano, F. M., & Henry, T. (2015). Data structures and abstractions with Java (4th ed.). Upper Saddle River, NJ: Pearson.

displayRowOfCharacters(‘*’, 5);
produces the line
*** 会
Implement this method in Java by using recursion.
2. Describe a recursive algorithm that draws concentric circles, given the diameter of the outermost circle. The
diameter of each inner circle should be three-fourths the diameter of the circle that encloses it. The diameter
of the innermost circle should exceed 1 inch.
3. Write a method that asks the user for integer input that is between 1 and 10, inclusive. If the input is out of
range, the method should recursively ask the user to enter a new input value.
4. The factorial of a positive integer n—which we denote as n!—is the product of n and the factorial of n – 1.
The factorial of 0 is 1. Write two different recursive methods that each return the factorial of n.
5. Write a recursive method that writes a given array backward. Consider the last element of the array first.
6. Repeat Exercise 5, but instead consider the first element of the array first.
7. Repeat Exercises 5 and 6, but write a string backward instead of an array.
8. A palindrome is a string that reads the same forward and backward. For example deed and level are
palindromes. Write an algorithm in pseudocode that tests whether a string is a palindrome. Implement your
algorithm as a static method in Java. Exercise 11 and Project 3 in Chapter 5 asked you to describe how to do
this using a stack
9. Segment 7.37 introduced the Fibonacci sequence. Computing this sequence recursively is inefficient and
takes too much time. Write two methods that each compute the nth term in the Fibonacci sequence by using
iteration instead of recursion. One method should use an array to store the Fibonacci numbers. The other
method should use three variables to contain the current term in the sequence and the two terms before it

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER