chapter 1 exercises
Chapter 1 exercises from CP4
July 6, 2024 · 39 words · 1 min read · tech, programming
exercise 1.1.1
Counter example: {0,0},{0,-1},{0,-2},{0,4},{0,-4},{4,4}
Greedy value: 6 + 1 + 4 = 11
Correct value: 4 + 4 + 1 = 9
exercise 1.1.2
O(n): 16C2 * 14C2 * … * 2C2 = 16! / 2^8
exercise 1.1.3
a quote i like
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन ।
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि ॥ 47 ॥
translation:
You have a right to perform your duties, but the results of your actions are not your concern. Never consider yourself to be the cause of the results of your activities, nor be attached to inaction.
Bhagavad Gita, Chapter 2, Verse 47