chap algorithm analysis given an array storing integers ordered by valuemodify the binary search routine to return the position of the first integer with value in the situation where can appear multiple times in the array be sure that your algorithm is th(log )that isdo not resort to sequential search once an occurrence of is found given an array storing integers ordered by valuemodify the binary search routine to return the position of the integer with the greatest value less than when itself does not appear in the array return error if the least value in the array is greater than modify the binary search routine to support search in an array of infinite size in particularyou are given as input sorted array and key value to search for call the position of the smallest value in the array that is equal to or larger than provide an algorithm that can determine in (log ncomparisons in the worst case explain why your algorithm meets the required time bound it is possible to change the way that we pick the dividing point in binary searchand still get working search routine howeverwhere we pick the dividing point could affect the performance of the algorithm (aif we change the dividing point computation in function binary from ( )/ to ( (( )/ ))what will the worst-case running time be in asymptotic termsif the difference is only constant time factorhow much slower or faster will the modified program be compared to the original version of binary(bif we change the dividing point computation in function binary from ( )/ to what will the worst-case running time be in asymptotic termsif the difference is only constant time factorhow much slower or faster will the modified program be compared to the original version of binary design an algorithm to assemble jigsaw puzzle assume that each piece has four sidesand that each piece' final orientation is known (topbottometc assume that you have available function bool compare(piece apiece bside adthat can tellin constant timewhether piece connects to piece on ' side ad and ' opposite side bd the input to your algorithm should consist of an array of random piecesalong with dimensions and the algorithm should put the pieces in their correct positions in the array your algorithm should be as efficient as possible in the asymptotic sense write