Question: Do this question ASAP Pleazzzze Question 1: (35 Marks) Given a group of characters a circular array Al ). It is required for each one
Do this question ASAP Pleazzzze

Question 1: (35 Marks) Given a group of characters a circular array Al ). It is required for each one to print the index of the first bigger character on its right. Print -1 if no one is bigger than it. Example 1: Explanation of example 1: (refer to the figure below) The given array Al of character is as follows: AD={L,B,Q.F.T.M) A[index] A[0] A[1] A[2] A[3] A[41 A[5] Output: Content T M 2 2 4 4-12 Regarding "L", the first bigger character on its right is Example 2 (.e., A[21), and hence 2 is printed. AD={J.P.S.D.N) Regarding "B" has also the same *Q* on her right, and hence 2 is printed again Output: ....and so on. 1 2 -1 4 1 B Q F a) Describe how a brute-force approach algorithm would solve the above problem (4 marks), and explain its complexity (2 marks). b) Design a more efficient algorithm to solve this problem. (8 marks) [The efficiency of your algorithm is the main driver of the mark], and analyze the complexity of your solution. (4 marks) [full explanation of your answer should be provided) c) Develop a python code to implement your efficient algorithm. (10 marks) [The marks depend on the correctness of the code, indentation, comments, test-case) d) Prepare a brief report (250 words) comparing the two algorithms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
