Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(10 points) Suppose you have been sent back in time and have arrived at the scene of an ancient Roman battle. It is your job
(10 points) Suppose you have been sent back in time and have arrived at the scene of an ancient Roman battle. It is your job to assign n spears to n Roman soldiers so that each soldier has a spear. It is best if your assignments minimize the difference in heights between the height of the man and the height of his spear. That is, if the ith man has height mi, and his spear has height s,, then you want to minimize : Imi-sil (a) Design algorithm to find the optimal, or near optimal, solution without evaluating all possible combinations. Include an explanation and pseudocode showing how your al gorithm works. (b) Compare the runtime complexity of your algorithm with the complexity of a brute force solution
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started