Data Types Flashcards

1
Q

List

A

Ordered, possible nested, mutable sequence of elements

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

Tuple

A

Ordered immutable sequence of elements

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

Dictionary

A

An unordered collection of key-value pairs

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

Set

A

Unordered collection of elements

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

Time complexity of various functions on a list

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

Time complexity of various function on a tuple

A

Append O(1)

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

Time complexity of various function on dictionaries and sets

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

How do dictionaries or sets achieve O(1) for both element addition and look up

A

Using a hash table
Hash maps keys to an integer

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

What is a series? How to make

A

One dimensional array of homogeneous data

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

How to create a vector in Python

A

List
Or
np.array()

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

Time complexity of various function on a Stack

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

When to use a Tree

A

To represent hierarchical relationships among data

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