Search Header Logo

Data Structure and Algorithm 1B

Authored by sirnil undefined

Information Technology (IT)

Professional Development

Used 5+ times

Data Structure and Algorithm 1B
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

100 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is part of the Java Collections Framework?

String

Array

ArrayList

BufferedReader

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the List interface in Java guarantee?

No duplicates and unordered elements

Unique elements only

Ordered collection with duplicates allowed

Sorted collection by default

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default initial capacity of an ArrayList in Java?

5

8

10

0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to sort a List in Java using natural ordering?

Collections.sort(list)

list.sort()

list.sortByNaturalOrder()

Arrays.sortList()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid implementation of the Set interface?

TreeSet

HashSet

LinkedHashSet

ArrayList

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of add() operation in HashSet (on average)?

O(n)

O(1)

O(log n)

O(n log n)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class allows duplicate elements and maintains insertion order?

HashSet

TreeSet

ArrayList

HashMap

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?