DSA 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

push
pop
peek
print

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

pop until you get to that point

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 Queue data structure?

A

dequeue
enqueue
peek
print

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 queue (not just the “front”)?

A

dequeue until you get there

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

sequential access - need to start at beginning and jump from node to node until you get there

does not need to be mutated to scan contents (unlike queues and arrays)

Scott’s answer:
array - 1 data structures, to add, must mutate
linked list - multiple data structure; can add nodes without mutating

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

list.next.next.next

.next until you get to the item you’re looking for

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

linked list

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