Data Structures Flashcards

1
Q

What does the acronym LIFO mean?

A

Last in First Out

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

What methods are available on a Stack data structure?

A

Peek Print Pop Push

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

What must you do to access the value at an arbitrary point in a stack (not just the “top”)?

A

You’d have to pop items off until you got to the value
then keep the popped items in an array or something
and then push them back on once you got that value

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

What does the acronym FIFO mean?

A

First in first out

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

What methods are available on a Stack data structure?

A

enqueue,deqeue,peek

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

What must you do to access the value at an arbitrary point in a stack (not just the “top”)?

A

you have to dequeue front value until you get to the value you want

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

How are linked lists different from an array?

A

A linked list is a collection of objects known as a node where node consists of two parts, i.e., data and address. Array elements store in a contiguous memory location

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

How would you access an arbitrary node in a linked list (not just the “head”)?

A

you keep calling next until you get the value you want

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