Computer Science Flashcards

1
Q

What is a Stack?

A

is a list-type abstract data structure that limits interaction to one end of the list.

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

What methods are available on a Stack data structure?

A

push(value) - adds value to top of stack

pop() - removes the top value from the stack and returns it

peek() - returns the top value of the stack without removing it

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

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

A

pop from the stack repeatedly until you find the point you need

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

What is a queue?

A

a list-type abstract data structure that limits interaction with its contents

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

What methods are available on a Queue data structure?

A

enqueue(value) - adds a value to the “back” of the queue.

dequeue() - removes the “front” value from the queue and returns it.

peek()- returns the front value without removing it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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 value until you get to the arbitrary point in the queue

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

What is a linked-list data structure?

A

A linked list is a concrete data structure consisting of a bunch of value-containing nodes strung together into a single sequential list

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

How are linked-lists different from an array?

A

linked-lists are sequential access like a queue, not random access like an array.

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

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

A

In order to go to a specific place in the list, you have to start at the beginning, then jump from node to node until you get to the specific node.

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

How is a linked-list different from a queue?

A

a linked-list doesn’t have to be mutated to see the next value in the linked-list

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