Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP COMP SCI A: CodeHS Units 6/7/8 VOCAB

Total questions: 26

Worksheet time: 13mins

Name
Class
Date
1.

What is an Array in Java?

a)

A data structure that can hold multiple values of the same type.

b)

A method to store key-value pairs.

c)

A function to iterate over a collection.

d)

A class to create objects.

2.

What is an Index in the context of Java Arrays?

a)

A unique identifier for each element in the array

b)

The size of the array

c)

The data type of the array

d)

The memory address of the array

3.

What does array.length return in Java?

a)

The number of elements in the array

b)

The size of the array in bytes

c)

The last index of the array

d)

The memory address of the array

4.

The purpose of array[index] in Java is to:

a)

Access the element at the specified index

b)

Change the size of the array

c)

Sort the array

d)

Delete the element at the specified index

5.

What are ArrayLists in Java?

a)

A type of array that can grow in size

b)

A fixed-size array

c)

A type of linked list

d)

A type of stack

6.

What are ArrayList Methods used for in Java?

a)

To store elements in a dynamic array

b)

To perform mathematical calculations

c)

To handle file input/output operations

d)

To manage network connections

7.

What is an Enhanced For Loop in Java?

a)

A loop that iterates over a range of numbers

b)

A loop that iterates over elements of an array or collection

c)

A loop that runs indefinitely

d)

A loop that executes a specific number of times

8.

What is a common error that occurs when attempting to modify an ArrayList while using an enhanced for loop?

a)

ConcurrentModificationException

b)

NullPointerException

c)

IndexOutOfBoundsException

d)

ClassCastException

9.

The process of traversing an ArrayList is:

a)

Iterating through each element using a loop

b)

Accessing elements randomly

c)

Sorting the elements

d)

Reversing the elements

10.

What is an algorithm?

a)

A step-by-step procedure for solving a problem or accomplishing a task.

b)

A type of computer hardware.

c)

A programming language.

d)

A software application.

11.

Simultaneous traversal is a technique used in computer science and programming.

a)

A method to traverse two or more data structures at the same time

b)

A technique to sort data

c)

A way to store data

d)

A method to delete data

12.

A linear search is a method for finding a target value within a list.

a)

It checks each element of the list sequentially until a match is found or the whole list has been searched.

b)

It divides the list into two halves to find the target value.

c)

It uses a hash table to find the target value quickly.

d)

It sorts the list before searching for the target value.

13.

A selection sort is:

a)

a sorting algorithm that divides the input into a sorted and an unsorted region

b)

a search algorithm that finds the position of a target value within a sorted array

c)

a method for finding the shortest path in a graph

d)

a technique for compressing data

14.

What is an insertion sort?

a)

A sorting algorithm that builds the final sorted array one item at a time

b)

A search algorithm that finds the position of a target value within a sorted array

c)

A data structure that follows the Last In First Out (LIFO) principle

d)

A method for finding the shortest path between nodes in a graph

15.

Network protocols are:

a)

rules that govern data communication

b)

hardware devices for networking

c)

software applications for browsing

d)

security measures for networks

16.

What are protocols for data sharing on the internet that define rules and conventions for communication between network devices?

a)

HTTP

b)

FTP

c)

SMTP

d)

TCP/IP

17.

What is the appropriate use of data based on circumstances?

a)

For making informed decisions

b)

For spreading misinformation

c)

For unauthorized access

d)

For personal gain

18.

What ensures the integrity, confidentiality, and availability of data?

a)

Security measures

b)

Data redundancy

c)

User access control

d)

Regular backups

19.

What are arrays that store arrays, with methods associated with them being the same as regular arrays?

a)

Arrays of arrays, also known as multidimensional arrays.

b)

Single-dimensional arrays

c)

Linked lists

d)

Stacks

20.

What is the process of traversing a 2D array by accessing all elements in a row before moving on to the next row?

a)

Row-major order

b)

Column-major order

c)

Diagonal order

d)

Zigzag order

21.

What is the process of traversing a 2D array by accessing all values at the first column in every row, before moving to the next column?

a)

The process is known as column-major order traversal.

b)

The process is known as row-major order traversal.

c)

The process is known as diagonal traversal.

d)

The process is known as zigzag traversal.

22.

What is the process to loop through an array and access each of the elements, with caution to avoid looping beyond the valid index values?

a)

Use a for loop with a condition that checks the length of the array

b)

Use a while loop without any condition

c)

Access elements randomly without checking index

d)

Use a do-while loop with a condition that always evaluates to true

23.

What is an enhanced for loop in Java used for?

a)

Iterating over arrays or collections

b)

Declaring variables

c)

Handling exceptions

d)

Performing arithmetic operations

24.

What is an alternate to a for or while loop that accesses each value in an array starting at the first value and proceeding in order?

a)

An alternate to a for or while loop for accessing each value in an array is the forEach method.

b)

Using a recursive function to access each value in an array.

c)

Utilizing a do-while loop to iterate over an array.

d)

Implementing a map function to transform array values.

25.

What is an 'Enhanced For Loop Variable' in Java?

a)

A variable used in a for-each loop to iterate over elements of an array or collection.

b)

A variable used to enhance the performance of a for loop.

c)

A variable that is declared outside the loop but used inside it.

d)

A variable that is used to terminate a loop.

26.

What are 'Common Array Algorithms' used for in computer science?

a)

Common Array Algorithms are used for various operations on arrays, such as searching, sorting, and manipulating data efficiently.

b)

Common Array Algorithms are used to create graphical user interfaces.

c)

Common Array Algorithms are used to develop mobile applications.

d)

Common Array Algorithms are used to design network protocols.