data structures Flashcards
1
Q
Tell me about stacks.
A
Last In First Out, Push Pop, you can only access values by ‘pushing’ to the top and ‘popping’ off the top of the stack.
5 4 3 2 1
2
Q
How can you use a stack to solve whether these braces are balanced?
‘(([{{()}}])’
A
you can pop each brace off and if ‘(([{{( === )}}])’ then true.
3
Q
Tell me about Queues
A
FIFO, enqueue, dequeue. You can enqueue to the back and dequeue from the front.
1
4
Q
Linked Lists.
A
You can only access the first index of a linked list.
You have to work from front to back
They are a pain in the ass