elementary data structures Flashcards

1
Q

advantages of arrays

A

memory efficient
can access any key quickly

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

disadvantages of arrays

A

cannot grow or shrink
removal and deletion is only efficienet for the element at the very end

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

advantages of linked lists

A

can grow and shrink as necessary
can remove and insert keys efficiently anywhere in the list

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

disadvantages of linked lists

A

larger memory overhead
cannot access all keys quickly

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

running time for searching in linked list

A

O(n)

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

running time for searching in array

A

O(1)

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

running time for insertion and deletion in (doubly) linked list

A

O(1)

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

running time for insertion and deletion in array and singly linked list

A

O(n)?

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

stack

A

LIFO

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

queue

A

FIFO

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

infix to postfix conversion algorithm + worst case

A

the shunting-yard algorithm
worst case: O(n)

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

worst case for computing postfix expression

A

O(n)

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