Project #89158 - Data structures ASsignment Help SET 1

1 set 10 $
 
1  of 10
When writing a recursive algorithm, what is the FIRST step?

 

2  of 10
When you have an exact definition of a recursive problem, what is the next step?

 

3  of 10
All of the following are stored on an activation record EXCEPT

 

4  of 10
Which of the following statements could describe the general (recursive) case of a recursive algorithm?

 

5  of 10
You are using a language that does not support recursion. What data structure would you use to traverse a binary search tree in order?

 

  of 10
Choose the simple recursive function that will raise a number to an exponential power by multiplication operations.

 

7  of 10
In the following recursive function, which line(s) represent the base case?
  
void PrintIt( /* in */ int n )        // Line 1
   {                                       // Line 2
    if (n == 0)                        // Line 3
     cout << n << endl;            // Line 4
    else                              // Line 5
    {                                  // Line 6
     cout << "Again" << endl;      // Line 7
     PrintIt(n - 1);               // Line 8
    }
                     }

 

8  of 10
In the following recursive function, which line(s) represent the general (recursive) case?
  
   void PrintIt( /* in */ int n )       // Line 1
   {                                      // Line 2
    if (n == 0)                       // Line 3
     cout << n << endl;           // Line 4
    else                             // Line 5
    {                                 // Line 6
     cout << "Again" << endl;     // Line 7
     PrintIt(n - 1);              // Line 8
    }
                      }

 

9  of 10
Given the recursive function
  
   int Func( /* in */ int n )
   {
    if (n == 5)
     return 5;
    else
     return 2 * Func(n + 1);
   }
  
 what is the value of the expression Func(2) ?

 

10  of 10

If the following function is called with a value of 3 for n, what is the resulting output?

void TapDance( /* in */ int n )
   {
    if (n > -1)
    {
     TapDance(n - 1);
     cout << "Flap";
    }
    else
     cout << "Shuffle";
                      }

 

Subject Computer
Due By (Pacific Time) 10/25/2015 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy