Question: 2) The function below tries to find and answer to, What is the list of the numbers that repeat 3 times in a given array?

 2) The function below tries to find and answer to, What

2) The function below tries to find and answer to, What is the list of the numbers that repeat 3 times in a given array?" ( e.g: array=[ 1 2 3 4 5 2 3 531162 7] is given to the function and it has 3 values which repeat 3 times (2,3 and 4) so the function will return [23"), if there is/are... please correct the error(s) in the given function below 1. function res=find_three_times (array) 2. for i=1:length (array) 3. found=0; 4. for j=1:length (array) 5. if array(j) ==array(i) 6. found=found+1; 7. end 8. end 9. end 10. for i=1:length(found) 11. if found (i)==2 12. res (cnt)=array(i); 13. cnt=cnt+1:1 14. end 15. end 16. eleminate_the_redundant (res); $the given function in Q1 is assumed to be corrected

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!