Write a recursive function, JAVA Programming

Assignment Help:

1) Write a function that uses recursion that converts a decimal number to octal (base 8). The function should accept a single integer and return a String containing the base 8 equivalent.

2) Write a recursive function that implement the following functions:

a. x0 = 1
xn = x * xn-1 if n > 0

b. x0 = 1
xn = (xn/2)2 if n > 0 and n is even
xn = x * (xn/2)2 if n> 0 and n is odd

3) How many multiplications will the functions you wrote in problem #2 perform when computing 319? 332?
How many recursive calls will the functions make when computing 319? 332?

4) Write a recursive function that implements the following function:

f(1) = 1; f(2) = 1; f(3) = 1; f(4) = 3; f(5) = 5
f(n) = f(n-1) + 3 * f(n-5) for all n > 5

Make the function as efficient as possible.

5) Compute f(n) for n = 6, 7, 12, 15


Related Discussions:- Write a recursive function

What is preferred organizational structure for organization, What is the pr...

What is the preferred organizational structure for the organization? Preferred Organizational Structure for organization is hierarchal. Where there is various departments inter

Swing, can we develop paint user can draw his charcters and images in swing...

can we develop paint user can draw his charcters and images in swing

Explain any five buzz words in java, Question 1 Explain any five buzz word...

Question 1 Explain any five buzz words in Java Question 2 Explain exception classes and also explain common exceptions in java Question 3 Explain primitive and abstract data t

Need to code using java in netbeans for my dissertation, I need to code usi...

I need to code using java in netbeans for my dissertation which is in data mining domain...deals with privacy preserving of sensitive rules or items using association rule hiding

Define the considerations for servlet clustering? , The clustering regulate...

The clustering regulates high scalability and availability. The basic considerations for servlet clustering are: 1. Objects opened in a session could be serializable to support

Elaborate with examples vector or object oriented graphics, Elaborate with ...

Elaborate with examples Vector or Object oriented graphics? Vector or Object-Oriented Graphics treats everything which is drawn as an object. Objects retain their identity afte

The software or script to scan automotive ads, The software or script to sc...

The software or script to scan automotive ads Project Description: Looking for a company that made the script or application to search through pages of listings of automotive

XML File Homework, I need help on java homework. Is it possible to know the...

I need help on java homework. Is it possible to know the shortest possible time to get the solution before giving my commitment

Write a program to find the area under the curve y = f(x) in, #question.Wri...

#question.Write a program to find the area under the curve y = f(x) in java.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd