Question: To which complexity class does the following algorithm belong? public static void mystery2 (int [] list) { for (int i = 0; i < list.length
To which complexity class does the following algorithm belong?
![public static void mystery2 (int [] list) { for (int i = 0; i < list.length / 2; i++) { int j = list.length 1 i; int temp = list[i]; list[i] = list[j]; list[j] temp;](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1607/3/1/7/0415fcdb631acbb31607317039474.jpg)
public static void mystery2 (int [] list) { for (int i = 0; i < list.length / 2; i++) { int j = list.length 1 i; int temp = list[i]; list[i] = list[j]; list[j] temp;
Step by Step Solution
3.26 Rating (167 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
