Searching ad Sorting

Searching ad Sorting

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Networking Quiz

Networking Quiz

8th - 9th Grade

15 Qs

HARDWARE AND SOFTWARE

HARDWARE AND SOFTWARE

2nd - 10th Grade

10 Qs

Q1 M 2 - TOPIC 2 / Check your understanding

Q1 M 2 - TOPIC 2 / Check your understanding

10th Grade

10 Qs

ICT - Networks and communication

ICT - Networks and communication

9th Grade

11 Qs

4Q Week3 Review Quiz (Who missed the Quiz ONLY))

4Q Week3 Review Quiz (Who missed the Quiz ONLY))

9th Grade

10 Qs

Traffic Light Project Quiz

Traffic Light Project Quiz

9th Grade

17 Qs

Cell Phone Vocabulary

Cell Phone Vocabulary

9th - 12th Grade

12 Qs

BP TIK 1

BP TIK 1

10th Grade

10 Qs

Searching ad Sorting

Searching ad Sorting

Assessment

Passage

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Arasaka Teacher

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the linear search algorithm for an array?

It checks each element in the sequence until the target is found or the end is reached

It repeatedly divides the sequence in half to locate the target value

It sorts the array first then searches for the target using binary search

It jumps to the middle of the sequence then searches toward one end ond

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int[] values = {10, 20, 30};

int target = 25;

int index = -1;

for (int i = 0; i < values.length; i++) {

if (values[i] == target) {

index = i;

}

}

System.out.println(index);

What is the output of the code above?

ArrayOutOfBoundsException

-1

3

endless loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int[] arr = {5, 8, 2, 8, 7};

int target = 8;

int index = -1;

for (int i = 0; i < arr.length; i++) {

if (arr[i] == target) {

index = i;

break;

}

}

System.out.println(index);

}

What is the output of the code above?

-1

1

3

8

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int[] arr = {5, 8, 2, 8, 7};

int target = 8;

int count = 0;

for (int i = 0; i < arr.length; i++) {

if (arr[i] == target) {

count++;

}

}

System.out.println(count);

}

What is the output of the code above?

0

1

2

5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following must be true in order to use binary search on an array?

The array's elements must be sorted

The array can't have 2 of the same value

The array must be divisible by 2

The array can be in any order to start

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you have a very large array of values (100,000+), which search method is most efficient?

linear search

binary search

both linear search and binary search

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the code?

-1

2

6

3

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?