Rearranging array element in largest and smallest and then second largest and second smallest sequence


 import java.util.*;
public class ArrangementofArray {

public static int[] rearrangeArray(int arr[], int n) {
int max = n - 1;
int min = 0;
boolean flag = true;
int[] result = new int[n];
for (int i = 0; i < n; i++) {
if (flag) {
result[i] = arr[max];
max--;
} else {
result[i] = arr[min];
min++;
}
flag = !flag;
}
return result;
}

public static void main(String args[]) {
int arr[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
int arr2[] = rearrangeArray(arr, arr.length);
System.out.println("The rearranged array is");
for (int i : arr2) {
System.out.print(i + ",");
}
System.out.println();
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...