All AP Computer Science A Resources
Example Questions
Example Question #1 : Sorting
What is the worst-case run-time of selection sort (in Big-O notation?)
Possible Answers:
Correct answer:
Explanation:
Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .
Example Question #2 : Sorting
True or False.
Selection sort is quicker than MergeSort.
Possible Answers:
True
False
Correct answer:
False
Explanation:
MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.
All AP Computer Science A Resources
Popular Subjects
French Tutors in Washington DC, Math Tutors in Chicago, Biology Tutors in Washington DC, English Tutors in Los Angeles, Statistics Tutors in Chicago, Biology Tutors in Boston, Chemistry Tutors in Washington DC, French Tutors in San Diego, ISEE Tutors in Philadelphia, Biology Tutors in Denver
Popular Courses & Classes
MCAT Courses & Classes in San Francisco-Bay Area, GMAT Courses & Classes in Seattle, MCAT Courses & Classes in Los Angeles, Spanish Courses & Classes in Chicago, MCAT Courses & Classes in San Diego, GRE Courses & Classes in Los Angeles, GMAT Courses & Classes in Phoenix, Spanish Courses & Classes in Phoenix, ISEE Courses & Classes in Dallas Fort Worth, SAT Courses & Classes in San Diego
Popular Test Prep
MCAT Test Prep in Miami, SSAT Test Prep in New York City, GRE Test Prep in Denver, LSAT Test Prep in Atlanta, MCAT Test Prep in Seattle, LSAT Test Prep in Los Angeles, SAT Test Prep in Phoenix, ACT Test Prep in Chicago, GMAT Test Prep in San Francisco-Bay Area, ISEE Test Prep in Seattle