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

A

O(n)

19
Q

Space usage of Unsorted Linked List

A

O(n)

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

A

O(n)

23
Q

Search for value in Sorted Linked List

A

O(n)

24
Q

Find Max/Min in sorted Linked List

A

O(n)

25
Q

Space usage for sorted Linked List

A

O(n)

26
Q

Insert in Self-balancing Binary Search Tree

A

O(log n)

27
Q

Delete in Self-Balancing Binary Search Tree

A

O(log n)

28
Q

Get value at index in Self-Balancing Binary Search Tree

A

N/A – No direct index

29
Q

Search for a key in Self-Balancing Binary Search Tree

A

O(log n)

30
Q

Find Min/Max in Self-Balancing Binary Search Tree

A

O(log n)

31
Q

Space usage in Self-Balancing Binary Search Tree

A

O(n)

32
Q

Insert into Heap

A

O(log n)

33
Q

Delete from Heap

A

O(log n) is value is min or max, O(n) for arbit element

34
Q

Get value at index in Heap

A

N/A – No direct index

35
Q

Search value in Heap

A

O(n)

36
Q

Find Min/Max in Heap

A

O(1)

37
Q

Space usage in Heap

A

O(n)

38
Q

Insert in HashTable

A

O(1)

39
Q

Delete from HashTable

A

O(1)

40
Q

Get value at index in HashTable

A

N/A

41
Q

Search for value in HashTable

A

O(1)

42
Q

Find Max/Min in HashTable

A

O(n)

43
Q

Space Usage in HashTable

A

O(n)

44
Q

What is the difference between Abstract Data Types and Data Structures

A

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