Linear Data Types Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a data structure?

A

Collection of data value arranged according to some rules (normally a collection of primitive data types).

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

What is an array?

A

An array is a fixed size collection of vales that have the same data types

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

What is does static mean?

A

Fixed size

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

What does homogeneous mean?

A

Same data type

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

What is the index of the first and last number in an array?

A

The first number is 0, the last number is length -1.

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

What the difference between list and an array?

A

A list is dynamic - essentially an array that can grow and shink

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

What is an Array list?

A

It is an array that has space to grow but if it reaches its limit, you need to create a new one.

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

What is a linked list?

A

A linked list is where every item has a pointer to the next item and it has no underlying data type.

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

What can u do with lists?

A

Append - length gets increased by one
Prepend - adds an item to the beginning so the list also appends
Insert - adds an item and every index number is increased
Remove - gets rid of an item so every index number is decreased

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

What is a multi-dimensional array?

A

A 2D one is like a table but a 3D one needs three indices to specify an element

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

What is a tuple?

A

A tuple is like an array but it is heterogeneous so it can have multiple data types

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

What is a record?

A

Uses labels instead of numeric indices, it can have different data types like tuples but they allow their values to change (mutate)

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

FIFO

A

First in last out. A queue is an example of this

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

LIFO

A

Last in first out. A stack is an example of this data structure

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