The worst-case time complexity for this function would be _________, where n is the number of elements.

```
1 bool search( Node ptr, Bird & bird, Bird dove )
2 {
3 if ( ptr == NULL )
4 return false;
5 if ( ptr->info == dove ) {
6 bird = ptr->info;
7 return true;
8 }
9 return search( ptr->next, bird, dove );
10 }
```
which is called for a linked list (where start points to the first node) using the lines of code:
```
if ( search( start, bird, dove ) )
cout << “search successful” << endl;
```
A. O( lg n )
B. O( 1 )
C. O( n2 )
D. O( n )


1

Computer Science & Information Technology

You might also like to view...

Providing array values is also called ____________________ the array.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The Print dialog box displays a(n) ____________________ of your document so that you can see exactly how it will look when printed.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The current directory is C:\Util\Drivers. To return to the root directory in one step, ________ may be entered

A) CD.. B) CD\ C) CD \Util\Drivers D) CD Root

Computer Science & Information Technology

A ____ page is designed to create a consistent layout for the pages in your application.

A. key B. default C. master D. super

Computer Science & Information Technology