24 Downloads

AP Computer Science Array Practice! Problem 1: Array Linear Search

AP Computer Science Array Practice! Problem 1: Array Linear Search
AP Computer Science Array Practice! Problem 1: Array Linear Search
AP Computer Science Array Practice! Problem 1: Array Linear Search
AP Computer Science Array Practice! Problem 1: Array Linear Search
Product Rating
4.0
1 Rating
File Type

PDF (Acrobat) Document File

Be sure that you have an application to open this file type before downloading and/or purchasing.

153 KB|2 pages
Share
Product Description

A review worksheet for free response linear array search questions on the AP Computer Science exam. Allows students write a search method using a for loop. Includes fully coded answer key!

Example:

Search an integer array of arbitrary length for a specific value n, and return the index at which this value n appears. If n is not in the array, return the value -1.

int[] arr = {3, 9, 30, 6, 8, 2, 4, 10};

int index = simpleSearch(arr, 30);

System.out.println(“Element 30 found at index = “ + index);

>> Element 30 found at index 2

Total Pages
2 pages
Answer Key
Included
Teaching Duration
N/A
Report this Resource
Loading...
CompSciGuy

CompSciGuy

3 Followers
Follow
More products from CompSciGuy
Product Thumbnail
Product Thumbnail
Product Thumbnail
Product Thumbnail
Product Thumbnail

Teachers Pay Teachers is an online marketplace where teachers buy and sell original educational materials.

Learn More

Keep in Touch!

Sign Up