Question: The algorithm depicted below is the C implementation of an algorithm called Poles. Examine and analyze the algorithm's implementation code carefully then answer the

The algorithm depicted below is the C implementation of an algorithm called

The algorithm depicted below is the C implementation of an algorithm called Poles. Examine and analyze the algorithm's implementation code carefully then answer the following questions. Show all detailed working. int Poles(int Hold[], int n, int p) } for(int i = 0; i < n; i++) { if(Hold[i] == p) { return i; } else 1 } } } return -1; a) What problem type does the algorithm's code appear to be addressing? [1 mark] b) What algorithmic category does the algorithm's code seem to be using? [1 mark] c) What is the Big O run time efficiency of the algorithm's code exactly as it is? [4 marks] d) Does the algorithm's implementation appear to be correct? If not, explain why and give the correct implementation without changing the algorithmic category, otherwise give back the correct code as is [2 marks] e) What is the Big O run time efficiency of the correct code given in d)? [4 marks] Show all your detailed diagrams and detailed workings in obtaining your answer. You can use a word processor, drawing program, etc to create and upload your answer here, or you can do your answer with pencil/pen and paper then take a picture of it and upload here. You can also type your answer in the text box.

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 Programming Questions!