Day4 Flashcards

1
Q

Dyn programming:
can sum and has sumin the array,
very imp to review

A

1) make a tree, root is your target
2) recurssion with memorization for the remainder of the number from for loop of all items in the array.
3) before returning any result store it in memory.

# can sum to a number in an array, elements can be reused
# with brute force has o(n^m), m was target sum and n was array length
# with below method it comes down to O(m^2*n) and space O(m^2)
# return the array
# return the array with shortest number of integars
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

2

A

2

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

3

A

3

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

4

A

4

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

5

A

5

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