Data Structures and Algorithms Flashcards

1
Q

What is “asymptotic amortized worst case analysis”

A

TBD

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

Insert time of Unsorted List

A

O(n)

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

Delete time of Unsorted List

A

O(n)

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

Get value at Index of Unsorted List

A

O(1)

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

Search Value for Unsorted List

A

O(n)

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

Find Max/Min in Unsorted List

A

O(n)

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

Space usage of Unsorted List

A

O(n)

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

Insert time of Sorted List

A

O(n)

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

Delete time of Sorted List

A

O(n)

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

Get value at Index Sorted List

A

O(1)

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

Search Value for Sorted List

A

O(log n)

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

Find Max/Min in Sorted List

A

O(1)

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

Space usage of Sorted List

A

O(n)

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

Insert into Unsorted Linked List

A

O(1) if the pointer to the next location is available. O(n) otherwise

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

Delete from Unsorted Linked List

A

O(1) if the pointer to the next location is available. O(n) otherwise

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

Get value at index in Unsorted Linked List

A

O(n)

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

Search for value in Unsorted Linked List

A

O(n)

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

Find Max/Min in Unsorted Linked List

19
Q

Space usage of Unsorted Linked List

20
Q

Insert into Sorted Linked List

A

O(1) if the pointer to the next location is available. O(n) otherwise

21
Q

Delete from Sorted Linked List

A

O(1) if the pointer to the next location is available. O(n) otherwise

22
Q

Get value at index for Sorted Linked List

23
Q

Search for value in Sorted Linked List

24
Q

Find Max/Min in sorted Linked List

25
Space usage for sorted Linked List
O(n)
26
Insert in Self-balancing Binary Search Tree
O(log n)
27
Delete in Self-Balancing Binary Search Tree
O(log n)
28
Get value at index in Self-Balancing Binary Search Tree
N/A -- No direct index
29
Search for a key in Self-Balancing Binary Search Tree
O(log n)
30
Find Min/Max in Self-Balancing Binary Search Tree
O(log n)
31
Space usage in Self-Balancing Binary Search Tree
O(n)
32
Insert into Heap
O(log n)
33
Delete from Heap
O(log n) is value is min or max, O(n) for arbit element
34
Get value at index in Heap
N/A -- No direct index
35
Search value in Heap
O(n)
36
Find Min/Max in Heap
O(1)
37
Space usage in Heap
O(n)
38
Insert in HashTable
O(1)
39
Delete from HashTable
O(1)
40
Get value at index in HashTable
N/A
41
Search for value in HashTable
O(1)
42
Find Max/Min in HashTable
O(n)
43
Space Usage in HashTable
O(n)
44
What is the difference between Abstract Data Types and Data Structures
ADT is the mathematical model, or concept-- describes the working-- E.g stacks, queues, A data structure is the implementation. E.g. A stack can be implemented using an array or a linked list