write a program in c++ by using arrays and loops . A traveller wants to travel from
Fantastic news! We've Found the answer you've been seeking!
Question:
write a program in c++ by using arrays and loops .
A traveller wants to travel from point A to point B and he has two path options (path1, path2). Find a new path with minimum cost from the beginning of any path to the end of any of the two paths. We can switch from one path to another path only at the common elements. The path costs are given: path1= [2,3,7,10,12] path2=[1,5,7,8] Output: 20 Explanation: first path will be: 2+3+7+10+12 = 34 Second path will be: 2+3+7+8= 20 As second path is smallest so output will be 20.
Related Book For
Introduction to Real Analysis
ISBN: 978-0471433316
4th edition
Authors: Robert G. Bartle, Donald R. Sherbert
Posted Date: