To find a value that is in an unordered array of 50 items, how many values must linear search examine on average?

A) 1
B) 6
C) 25
D) 50
E) 51


C) 25

Computer Science & Information Technology

You might also like to view...

(To-Do List Application) Use a JTextArea as a to-do list. Enter each item in a JTextField, and add it to the JTextArea by clicking a JButton. The item should be displayed in a numbered list as in Fig. 8.27. To do this, you will need JTextArea method getLineCount, which returns the number of lines in a JTextArea. The following statement assigns the number of lines displayed in the outputJTextArea to int variable counter: getLineCount, which returns the number of lines in a JTextArea. The following statement assigns the number of lines displayed in the outputJTextArea to int variable counter:

```
int counter = outputJTextArea.getLineCount();
```

```
a) Copying the template to your working directory. Copy the directory C:Examples Tutorial08ExercisesToDoList to your C:SimplyJava directory.
b) Opening the template file. Open the ToDoList.java file in your text editor.
c) Adding code to the event handler for the Add JButton. Add code to the addJBut- tonActionPerformed event handler (which begins in line 82) to obtain the number of lines displayed in the outputJTextArea. Get the user input from taskJText- Field append it the outputJTextArea with a line number in front of it. After the input is added to the outputJTextArea, clear the taskJTextField.
d) Saving the application. Save your modified source code file.
e) Opening the Command Prompt window and changing directories. Open the Command Prompt window by selecting Start > Programs > Accessories > Command Prompt. Change to your working directory by typing cd C:SimplyJavaToDoList.
```

Computer Science & Information Technology

Your disc will not eject from the CD/DVD drive even though you have pushed the eject button several times. What is your next step?

A) Replace the drive. B) Remove the drive, remove the drive cover, and use a small screwdriver to push the CD out the front. C) Use a paper clip and the emergency eject hole. D) Remove the computer power connector and reattach; then retry ejecting the disc.

Computer Science & Information Technology

Choose the sentence that applies correct capitalization.?

A. ?The Fourth of July holiday falls on Monday this year. B. ?The fourth of July holiday falls on Monday this year. C. ?The fourth of july holiday falls on monday this year.

Computer Science & Information Technology

A user, Ann, has been issued a smart card and is having problems opening old encrypted email. Ann published her certificates to the local windows store and to the global address list. Which of the following would still need to be performed?

A. Setup the email security with her new certificates B. Recover her old private certificate C. Reinstall her previous public certificate D. Verify the correct email address is associated with her certificate

Computer Science & Information Technology