Determine recursive c function computes, Basic Computer Science

QUESTION

(a) Give the two conditions required by a binary tree of depth d to be an almost complete binary tree.

(b) Determine what the following recursive C function computes. Write an iterative function to accomplish the same purpose.

int func(int n)

{

if (n == 0)

return(0);

return(n + func(n-1));

}

(c) Write a recursive algorithm to search a sorted array a for an element x between a[low] and a[high].

(d) Use your algorithm from part (c) to search for 17 from a sorted array that contains the elements 1, 3, 4, 5, 17, 18, 31 and 33.

Posted Date: 10/29/2013 3:47:30 AM | Location : United States







Related Discussions:- Determine recursive c function computes, Assignment Help, Ask Question on Determine recursive c function computes, Get Answer, Expert's Help, Determine recursive c function computes Discussions

Write discussion on Determine recursive c function computes
Your posts are moderated
Related Questions
Execute a command in operating system: In order to execute a command OS does the following steps:   It accepts a command from a user through mouse clicks or from t


Conditional constructs are used to integrate decision making into programs. The outcome of this decision making determines the series in which a program will execute instructions.

Question 1 Write a note on modems Question 2 What are the Safe Chatting Rules Question 3 Explain three basic kinds of hypertext links Question 4 Write a no

what is ms dos?

General Considerations for Search If we can specify the first state, the operators and the goal check for a look for difficulty, then we know where to create, how to move and w


Nursing Care Activity Module Retrieving of identification data of patient  Assessment of the patient  - Physical - Mental - Personal - Socio-c

Use the methods of C4.5 to design a decision tree

What role would you assign to each of the four workstation and any other equipment