Assignment-2.docx - ASSIGNMENT 2 Department of CS and SE Algorithm Analysis BS(CS 2017 st Due Date 31 October 2019 Question 1 A person urgently needs

Assignment-2.docx - ASSIGNMENT 2 Department of CS and SE...

This preview shows page 1 out of 1 page.

Algorithm Analysis BS(CS) 2017 Due Date: 31 st October 2019 Question 1: A person urgently needs 40kg of rice. He has only one shop to buy from. There are four qualities of rice at the shop: q1, q2, q3 and q4. The quantities in the stock along with their total prices are 5kg(PKR 600), 10kg(PKR 1300), 15kg(PKR 1500) and 20kg(PKR 2100) respectively. The person prefers low cost over quality. Give a solution i.e., the person buys best possible combination of rice, cost-wise. Question 2: Suppose, there are four sides: A, B, C and the final result is ABC. A is a 10×30 matrix, B is a
Image of page 1

Unformatted text preview: 30×5 matrix, C is a 5×60 matrix, and the final result is a 10×60 matrix; the regular polygon for this example is a 4-gon, i.e. a square. In which order should the matrices be multiplied? Question 3: In the supermarket there are 5 packages with the profit of 4, 2, 1, 2, 10 and their weights are 12, 2, 1, 1, and 4. A thief breaks into the supermarket, the thief cannot carry weight exceeding 17kg. Design a dynamic programming algorithm to find which packages the thief will take away to get the highest value. A SSIGNMENT 2 Department of CS and SE...
View Full Document

  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask bonus questions You can ask questions ( expire soon) You can ask questions (will expire )
Answers in as fast as 15 minutes