1.4.2 - data structures Flashcards

7

1
Q

one dimensional array

A

A finite, ordered set of elements of the same type stored in contiguous memory.

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

Does row or column come first in 2D array?

A

row

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

tuple

A

An immutable, ordered set of values of any data type.

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

immutable

A

Its elements cannot be changed and you cannot dynamically add or delete elements from a tuple.

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

record

A

Contains a number of fields, each holding one item of data.

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

list

A

A contiguously stored data structure consisting of a number of ​ordered ​items where the items can occur more than once​.

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

list.isEmpty()

A

Test for an empty list.

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

list.append(item)

A

Adds item to the end of a list.

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

remove(item)

A

Removes the first occurrence of an item from a list.

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

search(item)

A

Return whether an item exits in a list or not.

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

list.length()

A

Returns number of items in a list.

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

list.index(item)

A

Returns the position of item.

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

list.insert(position, item)

A

Insert a new item at position.

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

list.pop()

A

Remove and return the last item in the list.

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

list.pop(position)

A

Remove and return the item at position.

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

linked list

A

A dynamic data structure used to hold an ordered sequence not necessarily in contiguous data locations.

17
Q

What is each item in a linked list called?

A

a node

18
Q

2 parts of a node and their explanation

A
  • data field: actual item
  • pointer field: contains address of next item in sequence.