Array 3 Flashcards

1
Q

You can access any array item by using its ______.

A

Index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Syntax for accessing array elements

A

arrayName[indexNum]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The array index starts with _. You can also access the last
element of an array using the _
index

A

0, -1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

_________is to insert one or more data elements into an array. Based on the requirement, a new element can be
added at the beginning, end, or any given index of array.

A

Insertion operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In insertion operation, we add a data element at the middle of the
array using the python in-built ______method.

A

insert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Syntax in insertion operation

A

array.insert(index, element)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

_______refers to removing an existing element from the array and re-organizing all elements of an array.

A

Deletion Operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In deletion operation we remove a data element at the middle of
the array using the python in-built ______
method.

A

remove()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Syntax in deletion operation

A

array.remove(element)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You can perform a search for an array element based on its
value or its index.

A

Search operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In search operation, we search a data element using the python in-built _____ method.

A

index()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When we compile and execute with search operation, it produces the following result which shows the _____ of the element.

A

index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If the value is not present in the array then the program returns an _____.

A

error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Syntax for Search operation

A

array.index(element)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

_______refers to updating an existing element from the array at a given index.

A

Update operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

We simply reassign a new value to the
desired index we want to update.

A

Update operation

17
Q

Syntax for update operation

A

array[index]=element