Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Subtopic: Arraylists Clear filter

Questions 151–160 of 225
  1. 151
  2. 152
  3. 153
  4. 154
  5. 155
  6. 156
  7. 157
  8. 158
  9. 159
  10. 160

Question 151

Free response Arraylists
GapInserter receives a strictly increasing ArrayList . Whenever two ORIGINAL consecutive values differ by exactly2, add the missing integer between them. Larger…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 152

Free response Arraylists
UniqueWordAnalyzer processes nonempty lowercase comments. Words are separated by single spaces; each comment contains at least one word. public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 153

Multiple choice Arraylists
Meetings use half-open intervals[start,end), so touching endpoints do not conflict. For meetings[2,4),[4,6),[3,5), what pair is returned by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 154

Free response Arraylists
The Gizmo class represents gadgets that people purchase. Some Gizmo objects are electronic and others are not. A partial definition of the Gizmo class is shown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 155

Free response Arraylists
Shipment stores destination, weight in kilograms and fragile status. ShipmentTracker maintains an ArrayList . Do not use Map or HashMap for grouping. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 156

Multiple choice Arraylists
Assume java.util.ArrayList is imported. What is printed? ArrayList list=new ArrayList ()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 157

Multiple choice Arraylists
What is printed? String[] cities={"Atlanta","Boston","Chicago"} for(String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 158

Multiple choice Arraylists
For which category of lists does this method always remove every negative element?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 159

Multiple choice Arraylists
Which replacement makes this an unbiased Fisher–Yates shuffle, assuming Math.random() is uniform? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 160

Multiple choice Arraylists
Complete rateIsIncreasing so it returns true exactly when every daily gain is positive and gains strictly increase. prices contains at least three finite…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 151 of 225
Page 16 of 23