Determine recursive c function computes, Basic Computer Science


(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(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
Suppose there are exactly five packet switches (Figure 4) between a sending host and a receiving host connected by a virtual circuit line (shown as dotted line in figure 4). The tr

COMPUTER DATABASES: As would be evident from the foregoing description, literature search is essentially a process of information retrieval. The term "Information Retrieval" w

I am using block matching algorithm to get the motion vectors, now, how can I get the depth map/depth value from the motion vectors?

Give birth to new life forms A research of Artificial Life will definitely throw light on what it means for a complex application to be 'alive'. Moreover, ALife researchers th

Question 1 List down any six features of a Smartphone Question 2 Give a brief note on a) Internal Flash Disk. b) Use of C++ in Symbian OS Question 3 What are the naming

how to use computer and how we can manage it

create a simple Visual Basic project

write a program to solve a 10x10 maze. prompt the user for an input text file containing ten rows(ten characters on each row). Use following characters in the input file: * startin

The GIGO Principle : This is a simple principle with a clear message and universal application - Garbage In - Garbage out! Always try and enter any data in the form you want to