Question: guys I need the solve by OUBUILD program please and thanks a lot Question 3: (10 marks) There are some people standing in a circle.

 guys I need the solve by OUBUILD program please and thanksa lot Question 3: (10 marks) There are some people standing in

guys I need the solve by OUBUILD program please

and thanks a lot

Question 3: (10 marks) There are some people standing in a circle. You are given their heights in an a list of A[].lt is required for each one to print the index of the first person taller than him on his right (print -1 if no one is taller than him). Example 1: Example 2: List = [175,166,184,170,187,167] List = [174,180,184,160,177] Output: Output: 2 2 4 4 -1 0 1 2 -1 4 1 | 121 | 03 | Al Jasi Explanation of example 1: The given list All of heights is as follows: A[index]A[0] A[1] A[2] A[3] A[4] A[5] Content 175 166 187 167 The person at the starting point of the circle has a height 175. The first person taller than her on her right is 184 (i.e., A[2]). As It is required for each one to print the index of the first person taller than him on his right, 2 is printed. The second one with height 166 has also the same person on her right. Therefore 2 is printed again... and so on 184 170 167 187 Input list=[175, 166,184,170,187,167] 17 170 to right 166 184 output 2 244-10 1. Design an algorithm to solve this problem by using loop and if statement with providing full comments on the code. According the complexity which is covered in the TM111 chapter 6 you should make your algorithm efficient. 2- Explain the mechanism of your algorithm by your own words 3- Does your algorithm efficient or not (explain based on your answer)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!