Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Introduction to Arrays

star
star
star
star
star
Last updated over 8 years ago
6 Nsɛmmisa
1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
3.

In general, when do you think you should store information in an array, and when should you use a variable?

1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

Regarding JavaScript, there is a difference between a list and an array

Asemmisa {{asɛmmisaAhyɛnsode}}
2.

An Array is an object used to store multiple values in a single variable

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

Consider searching for a given value in an array. Which of the following must be true in order to successfully use the binary search?

I. The values in the array must be numbers.

II. The values in the array must be in sorted order.

III. The array must not contain any duplicate values.

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

Consider searching for a given value in a sorted array. Under which of the following circumstances will the sequential search be faster than the binary search?

Asemmisa {{asɛmmisaAhyɛnsode}}
6.

Assume the following declarations and assignments have been made.

int[] arr1 = {1, 2, 3, 4, 5, 6, 7, 8};

int[] arr2 = {4, 5, 6, 7, 8};

If the following segment of code is executed, what will arr1 and arr2 contain?

arr2 = arr1;

arr2[3] = 0;