main.java
//it is practical yet  and likely would have been use in a few of the prior functions if it was implemented earlier
it is practical yet  and likely would have been use in a few of the prior functions if it was implemented earlier
it is practical yet and likely would have been use in a few of the prior functions if it was implemented earlier
public static int[] backwards_list_2(int[] list) {
		int length = list.length;
		if(length == 0) {
		}
		else if(length == 1) {
		}
		else if(length == 2) {
			int tmp_num = list[0];
			list[0] = list[1];
			list[1] = tmp_num;
		}
		else if(length % 2 == 0) {
			for(int x = 0; x <= length/2; x++ ) {
				int tmp_num = list[x];
				list[x] = list[length-x-1];
				list[length-x-1] = tmp_num;
			}
		}
		else {
			for(int x = 0; x < length/2; x++ ) {
				int tmp_num = list[x];
				list[x] = list[length-x-1];
				list[length-x-1] = tmp_num;
			}
		}
		return list;
	}
public static int [ ] backwards_list_2 ( int [ ] list ) { int length = list . length ; if ( length == 0 ) { } else if ( length == 1 ) { } else if ( length == 2 ) { int tmp_num = list [ 0 ] ; list [ 0 ] = list [ 1 ] ; list [ 1 ] = tmp_num ; } else if ( length % 2 == 0 ) { for ( int x = 0 ; x <= length / 2 ; x ++ ) { int tmp_num = list [ x ] ; list [ x ] = list [ length - x - 1 ] ; list [ length - x - 1 ] = tmp_num ; } } else { for ( int x = 0 ; x < length / 2 ; x ++ ) { int tmp_num = list [ x ] ; list [ x ] = list [ length - x - 1 ] ; list [ length - x - 1 ] = tmp_num ; } } return list ; }
it is practical yet  and likely would have been use in a few of the prior functions if it was implemented earlier
it is practical yet and likely would have been use in a few of the prior functions if it was implemented earlier
//the first 3 if statements branch off cases where the code would run incorrectly //just need to branch off this exception case from main code //just need to branch off this exception case from main code //the reason this cases is need is because if it was run in the main for loop it would reverse the list then reverse it again returning it to it's original state //for cases where there are an odd number of elements //loop until you reach the middle //replace the the number at x with the number that is equally distant from the end as x is from the start // same logic as the previous but for lists with an odd number of elements