data-structures Flashcards

1
Q

LIFO?

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 push pop

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?

A

pop repeatedly until the end?

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

time complexity of stack?

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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
6
Q

What methods are available on a Queue data structure?

A

peek, enqueue, dequeue

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

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

A

dequeue from the front until you get the element that we’re looking for

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

how are linked lists different from an array?

A

An array is a collection of elements of a similar data type. Linked List is an ordered collection of elements of the same type in which each element is connected to the next using pointers. (sequential)

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

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

A

start from the beginning and jump to node to node O(n) linear time

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