Question 3 Suppose, you have $10 to buy food for a day. You have several options, but you need to maximize total calories from the food items for longer survival. Apply dynamic programming technique to choose the items so that you can have maximum calories from the given amount of money. You are not allowed to waste any food, so if you choose an item, you will eat it completely Item Price Calories $3 Cheese Burger 250 cal Pizza 295 cal Chicken fry $3 225 cal $2 290 cal Salad $1 180 cal Apply dynamic programming technique to find the maximum calorie you can eat. mWrite and simulate the algorithm to find the selected items for optimal calorie intake within $10. Fried rice (m) Analyze the time complexity of your algorithm in (i).
Question 3 Suppose, you have $10 to buy food for a day. You have several options, but you need to maximize total calories from the food items for longer survival. Apply dynamic programming technique to choose the items so that you can have maximum calories from the given amount of money. You are not allowed to waste any food, so if you choose an item, you will eat it completely. Item Price Calories Cheese Burger Pizza Chicken fry Fried rice Salad $3 $2 $3 $4 $1 250 cal 290 cal 225 cal 295 cal 200 cal (1) Apply dynamic programming technique to find the maximum calorie you can eat. (ii) Write and simulate the algorithm to find the selected items for optimal calorie intake within $10. (iii) Analyze the time complexity of your algorithm in (ii).
没有找到相关结果