Midterm Lecture ---> Arrays Flashcards

1
Q
  • a container which can hold a fix number of
    items and these items should be of the same type.
  • A linear data structure where elements are
    allocated contiguous memory, allowing for constant-
    time access.

-can only include input variables of the same data type.

A

Arrays

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

Each item stored in an array

A

Element

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

Each location of an element in an array
has an _____ , which is used to identify the
element.

A

Index

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

Prints all the array elements one by one.

A

Traverse

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

Adds an element at the given index.

A

Insertion

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

Deletes an element at the given index.

A

Deletion

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

Searches an element using the given index or by
the value.

A

Search

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

Updates an element at the given index.

A

Update

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

Types of arrays:

A

Fixed Size Array
Dynamic Sized Array
1 - Dimensional Array
Multi - Dimensional Array

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

cannot alter or update the size of this
array. Here only a fixed size (i,e. the size that is mentioned
in square brackets []) of memory will be allocated for
storage.

A

Fixed Size Array

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

The size of the array changes as per
user requirements during execution of code so the coders
do not have to worry about sizes. They can add and
removed the elements as per the need. The memory is
mostly dynamically allocated and de-allocated in these
arrays.

A

Dynamic Sized Array

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

You can imagine a 1d array
as a row, where elements are stored one after another.

A

One - Dimensional Array

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

can be considered as an array
of arrays or as a matrix consisting of rows and columns.

A

Multi - Dimensional Array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • are a way to group
    several related variables into one place.
  • can contain many different
    data types (int, float, char, etc.)
  • can include input variables of multiple data
    types.
A

Structures

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

a collection of items that are all of
the same type (grocery items, integers,
names)

A

List

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