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]
2
Q
what are the two main elements of dynamic programming?
A
overlapping sub problems and searching for an optimal substructure
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