Вы находитесь на странице: 1из 5

Course: Easy-to-follow Java programming

The quiz questions


Answer the questions below to review what you have learned in Video 13. You will
find the right answers after the questions in the solution part.

1. Collection Framework is…

… a lot of classes for storing elements.

… a factory that creates picture frames.

… a tool set that is for creating new classes.

… a lot of classes and algorithms that are in connection with storing


elements.

2. What is true for List?

Lists are similar to arrays.

Size of List is fixed.

List can contain any values.

You can use [] for indexing elements just like in the case of arrays.

Lists are like phone books.

Lists contain elements in specified order.

List is subclass of Collection.

Duckademy IT courses – www.duckademy.com


3. What is true for Map?

Maps are similar to arrays.

Size of Map is fixed.

Keys and values of Maps have to be objects.

You can use [] for indexing elements just like in the case of arrays.

Maps are like phone books.

All Maps contain elements in the insert order.

Map is subclass of Collection.

4. What is true for Set?

Sets are similar to arrays but they do not store element order.

Size of Set is flexible.

Values of Sets have to be objects.

You can use [] for indexing elements just like in the case of arrays.

Sets are like phone books.

The order of elements is based on the actual implementation.

Set is subclass of Collection.

5. What is true for hashing?

Hashing is for specifying the position of the elements based on the


value.

Hashing is for accelerating retrieval of elements.

Hasing can be slow in corner cases.

Hashing is only for storing numbers.

Java uses bucket hash in the case of HashSets and HashMaps.

If two objects are equal, their hash codes have to be equal.

Duckademy IT courses – www.duckademy.com


6. What is true for binary sorting trees?

They contain elements in a form in which every element has 2 or 3


children.

Left elements of the binary sorting tree is less than the right elements.

Every element has exactly 2 children.

Binary trees can be unbalanced.

You can put elements in a binary sorting tree wherever you want.

A tree is a linear structure.

Duckademy IT courses – www.duckademy.com


----------------------------------------------------------------------------------------------------------------

The answers

1. Collection Framework is…

… a lot of classes for storing elements.

… a factory that creates picture frames.

… a tool set that is for creating new classes.

X … a lot of classes and algorithms that are in connection with


storing elements.

2. What is true for List?

X Lists are similar to arrays.

Size of List is fixed.

List can contain any values.

You can use [] for indexing elements just like in the case of arrays.

Lists are like phone books.

X Lists contain elements in specified order.

X List is subclass of Collection.

3. What is true for Map?

Maps are similar to arrays.

Size of Map is fixed.

X Keys and values of Maps have to be objects.

You can use [] for indexing elements just like in the case of arrays.

X Maps are like phone books.

All Maps contain elements in the insert order.

Map is subclass of Collection.

Duckademy IT courses – www.duckademy.com


4. What is true for Set?

X Sets are similar to arrays but they do not store element order.

Size of Set is flexible.

X Values of Sets have to be objects.

You can use [] for indexing elements just like in the case of arrays.

Sets are like phone books.

X The order of elements is based on the actual implementation.

X Set is subclass of Collection.

5. What is true for hashing?

X Hashing is for specifying the position of the elements based on


the value.

X Hashing is for accelerating retrieval of elements.

X Hasing can be slow in corner cases.

Hashing is only for storing numbers.

Java uses bucket hash in the case of HashSets and HashMaps.

X If two objects are equal, their hash codes have to be equal.

6. What is true for binary sorting trees?

They contain elements in a form in which every element has 2 or 3


children.

X Left elements of the binary sorting tree is less than the right
elements.

X Every element has exactly 2 children.

X Binary trees can be unbalanced.

You can put elements in a binary sorting tree wherever you want.

A tree is a linear structure.

Duckademy IT courses – www.duckademy.com

Вам также может понравиться