Counting sort Flashcards

1
Q

step through counting sort

A

step through array A adding 1 to array C at the address of the data at A[i]

then change array C into a cumulative array

then loop through A backwards
subtract 1 from the the data stored in C at address A[i]

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

what are the two main elements of dynamic programming?

A

overlapping sub problems and searching for an optimal substructure

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

what to do when finding a general solution to a recurrence (specifically like fibby) when there are distinct solutions

A

add the two together
each with their own coeff

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