Question: Based on the above algorithms, our goal is to identify the largest number in the string below (i.e. this is an optimization problem). Compare the

Based on the above algorithms, our goal is to identify the largest number in the string below (i.e. this is an optimization problem). Compare the execution of a brute-force, a hill-climbing and a divide-and-conquer approach.
A. Brute Force B. Hill Climbing C. Divide and Conquer
Which one completes its execution faster?
A, B, or C?
Which one performs the most comparisons?
A, B, or C?
Which guarantee finding the global optimum?
A, B, C, A & B, A & C, B & C, A & B & C
Brute-force(list) CurrMax-0 CurrPos-1 while CurrPosclength(list)+1 Divide-and-conquer(list) CurrPos-1 Newl ist ] while CurrPosclength(list)+1 f list[CurrPos]>CurrMax then if list[CurrPos>list[CurrPos 1] then CurrMax-list[CurrPos] newlist.append(list[CurrPos]) else end if newlist.append(list[CurrPos+1]) CurrPos-CurrPoS+1 end while print CurrMax end if CurrPos-CurrPos+2 end while if length(list) 1 then Hill-climbing(list) CurrMax-0 CurrPos=1 while CurrPosclength(list)+1 Divide-and-conquer(list-newlist) print list 1] we assume that if list/CurrPos+1] does not else end if f list[CurrPos]>CurrMax then CurrMax=list[CurrPos] CurrPos-CurrPos+1 exist, it returns 0 else CurrPos-CurrPos+1 exit while end while print CurrMax
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
