Reset author name to chosen name ✨
This commit is contained in:
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
package com.chloefontenot.mp1_chloefontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class Lab3DArraysSort_ChloeFontenot {
|
||||
|
||||
public static int maxNumberOfColumnsInJagged2dArray(char[][] ar) {
|
||||
int maxNumberOfColumns = 0;
|
||||
for (int row = 0; row < ar.length; ++row) {
|
||||
if (ar[row].length > maxNumberOfColumns) {
|
||||
maxNumberOfColumns = ar[row].length;
|
||||
}
|
||||
}
|
||||
|
||||
return maxNumberOfColumns;
|
||||
}
|
||||
|
||||
public static void printColumnMajorOrder(char[][] ar) {
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
int max = maxNumberOfColumnsInJagged2dArray(ar);
|
||||
for (column = 0; column < max; ++column) {
|
||||
for (row = 0; row < ar.length; ++row) {
|
||||
if (column < ar[row].length) {
|
||||
System.out.print(ar[row][column] + " ");
|
||||
}
|
||||
}
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints row by row
|
||||
*
|
||||
* @param ar
|
||||
*/
|
||||
public static void printRowMajorOrder(char[][][] array) {
|
||||
for (char[][] i: array) {
|
||||
System.out.println("---------------------------------");
|
||||
printRowMajorOrder(i);
|
||||
}
|
||||
}
|
||||
public static void printRowMajorOrder(char[][] ar)//normal
|
||||
{
|
||||
for (int x = 0; x < ar.length; ++x) {
|
||||
for (int y = 0; y < ar[x].length; ++y) {
|
||||
System.out.print(ar[x][y] + "");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String returnRowMajorOrder(char[] ar)//normal
|
||||
{
|
||||
String returnString = "";
|
||||
for (int x = 0; x < ar.length; ++x) {
|
||||
returnString += ar[x];
|
||||
}
|
||||
return returnString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the methods in ascending order using Selection Sort
|
||||
*
|
||||
* @param names the names to be sorted
|
||||
*/
|
||||
public static void sortNames(char[][][] names) {
|
||||
for (int array = 0; array < names.length; ++array) {
|
||||
System.out.println("times looped: " + array);
|
||||
for (int i = 0; i < names[array].length - 1; ++i) {
|
||||
for (int j = i + 1; j < names[array].length; ++j) {
|
||||
char compChar1 = names[array][i][0], compChar2 = names[array][j][0];
|
||||
// Reoder entire row
|
||||
for (int rowIterate = 1; rowIterate < maxNumberOfColumnsInJagged2dArray(names[array]); ++rowIterate) {
|
||||
if (Character.toLowerCase(compChar1) == Character.toLowerCase(compChar2)) {
|
||||
try {
|
||||
compChar1 = names[array][i][rowIterate];
|
||||
compChar2 = names[array][j][rowIterate];
|
||||
} catch (Exception ex) {
|
||||
// If it's failed, the index has gone out of range.
|
||||
// Check the length of the arrays and swap the larger one with the smaller one.
|
||||
if (names[array][i].length > names[array][j].length) {
|
||||
System.out.println(names[array][i].length + " " + names[array][j].length);
|
||||
System.out.println("Swapping " + returnRowMajorOrder(names[array][i]) + " with " + returnRowMajorOrder(names[array][j]));
|
||||
char[] temp = names[array][i];
|
||||
names[array][i] = names[array][j];
|
||||
names[array][j] = temp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (Character.toLowerCase(compChar1) > Character.toLowerCase(compChar2)) {
|
||||
System.out.println("Swapping " + returnRowMajorOrder(names[array][i]) + " with " + returnRowMajorOrder(names[array][j]));
|
||||
char[] temp = names[array][i];
|
||||
names[array][i] = names[array][j];
|
||||
names[array][j] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*
|
||||
char[][] names = {
|
||||
{'j', 'o', 'h', 'n'},
|
||||
{'a', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n'},};
|
||||
*/
|
||||
///*
|
||||
char[][][] names = {
|
||||
{
|
||||
{'j', 'o', 'h', 'n'},
|
||||
{'a', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n', 'i'},
|
||||
{'a', 'a', 'o', 'n'},
|
||||
{'b', 'b', 'b', 'b'},
|
||||
{'b', 'b', 'b', 'c'},
|
||||
{'b', 'b', 'b'}
|
||||
},
|
||||
{
|
||||
{'L', 'i', 's', 's', 'e', 't'},
|
||||
{'E', 't', 'h', 'a', 'n'},
|
||||
{'C', 'a', 'l', 'e', 'b'},
|
||||
{'L', 'u', 'l', 'y'},
|
||||
{'C', 'h', 'a', 'n', 'c', 'e'}
|
||||
}
|
||||
};
|
||||
//*/
|
||||
//printColumnMajorOrder(names);
|
||||
printRowMajorOrder(names);
|
||||
System.out.println();
|
||||
sortNames(names);
|
||||
System.out.println();
|
||||
printRowMajorOrder(names);
|
||||
//printColumnMajorOrder(names);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,267 +0,0 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
package com.chloefontenot.mp1_chloefontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class MP1_ChloeFontenot {
|
||||
|
||||
public static int[][] inputArray() {
|
||||
int m, n, i, j;
|
||||
// Create scanner
|
||||
Scanner input = new Scanner(System.in);
|
||||
System.out.print("Enter the number of rows: ");
|
||||
//taking row as input
|
||||
m = input.nextInt();
|
||||
System.out.print("Enter the number of columns: ");
|
||||
//taking column as input
|
||||
n = input.nextInt();
|
||||
// Declaring the two-dimensional matrix
|
||||
int returnArray[][] = new int[m][n];
|
||||
// Read the matrix values
|
||||
System.out.println("Enter the elements of the array: ");
|
||||
//loop for row
|
||||
for (i = 0; i < m; i++) //inner for loop for column
|
||||
{
|
||||
for (j = 0; j < n; j++) {
|
||||
returnArray[i][j] = input.nextInt();
|
||||
}
|
||||
}
|
||||
//accessing array elements
|
||||
System.out.println("Elements of the array are: ");
|
||||
for (i = 0; i < m; i++) {
|
||||
for (j = 0; j < n; j++) {
|
||||
return returnArray;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isConsecutiveFour(int[] values) {
|
||||
for (int i = 0; i < values.length - 4; ++i) {
|
||||
if (values[i] == values[i + 1]
|
||||
&& values[i + 1] == values[i + 2]
|
||||
&& values[i + 2] == values[i + 3]) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void main(String[] args) { //2965
|
||||
int[][] horizontalTestArray = { // Horizontal
|
||||
{0, 1, 0, 3, 1, 6, 1},
|
||||
{0, 1, 6, 8, 6, 0, 1},
|
||||
{5, 6, 2, 1, 8, 2, 9},
|
||||
{6, 5, 6, 1, 1, 9, 1},
|
||||
{1, 3, 6, 1, 4, 0, 7},
|
||||
{3, 3, 3, 3, 4, 0, 7}
|
||||
};
|
||||
|
||||
int[][] verticalTestArray = { // Vertical
|
||||
{0, 1, 0, 3, 1, 6, 1},
|
||||
{0, 1, 6, 8, 6, 0, 1},
|
||||
{5, 5, 2, 1, 8, 2, 9},
|
||||
{6, 5, 6, 1, 1, 9, 1},
|
||||
{1, 5, 6, 1, 4, 0, 7},
|
||||
{3, 5, 3, 3, 4, 0, 7}
|
||||
};
|
||||
int[][] diagonalTestArray1 = { // Diagonal 1
|
||||
{0, 1, 0, 3, 1, 6, 1},
|
||||
{0, 1, 6, 8, 6, 0, 1},
|
||||
{9, 6, 2, 1, 8, 2, 9},
|
||||
{6, 9, 6, 1, 1, 9, 1},
|
||||
{1, 3, 9, 1, 4, 0, 7},
|
||||
{3, 3, 3, 9, 4, 0, 7}
|
||||
};
|
||||
int[][] diagonalTestArray2 = { // Diagonal 2
|
||||
{0, 1, 0, 3, 1, 6, 1},
|
||||
{0, 1, 6, 8, 6, 0, 1},
|
||||
{9, 6, 2, 1, 8, 2, 9},
|
||||
{6, 9, 6, 1, 1, 9, 1},
|
||||
{1, 3, 9, 1, 4, 0, 7},
|
||||
{3, 3, 3, 9, 4, 0, 7}
|
||||
};
|
||||
|
||||
// Create scanner
|
||||
Scanner input = new Scanner(System.in);
|
||||
int userInput;
|
||||
do {
|
||||
System.out.println("Do you want to enter an array, or use a predefined one?");
|
||||
System.out.println("1. Use predefined array.");
|
||||
System.out.println("2. Enter a new array.");
|
||||
System.out.println("-1. quit and exit program");
|
||||
System.out.print("Input: ");
|
||||
userInput = input.nextInt();
|
||||
if (userInput == 1) {
|
||||
System.out.println("Selected \"Use predefined array\"");
|
||||
System.out.println("Printing arrays...");
|
||||
System.out.println("1. horizontalTestArray");
|
||||
printArray(horizontalTestArray);
|
||||
System.out.println("2. verticalTestArray");
|
||||
printArray(verticalTestArray);
|
||||
System.out.println("3. diagonalTestArray1");
|
||||
printArray(diagonalTestArray1);
|
||||
System.out.println("4. diagonalTestArray2");
|
||||
printArray(diagonalTestArray2);
|
||||
System.out.print("Input: ");
|
||||
userInput = input.nextInt();
|
||||
if (userInput == 1) {
|
||||
if (isConsecutiveFour(horizontalTestArray)) {
|
||||
System.out.println("Testing method returns true");
|
||||
} else {
|
||||
System.out.println("Testing method returns false");
|
||||
}
|
||||
}
|
||||
if (userInput == 2) {
|
||||
if (isConsecutiveFour(verticalTestArray)) {
|
||||
System.out.println("Testing method returns true");
|
||||
} else {
|
||||
System.out.println("Testing method returns false");
|
||||
}
|
||||
}
|
||||
if (userInput == 3) {
|
||||
if (isConsecutiveFour(diagonalTestArray1)) {
|
||||
System.out.println("Testing method returns true");
|
||||
} else {
|
||||
System.out.println("Testing method returns false");
|
||||
}
|
||||
}
|
||||
if (userInput == 4) {
|
||||
if (isConsecutiveFour(diagonalTestArray2)) {
|
||||
System.out.println("Testing method returns true");
|
||||
} else {
|
||||
System.out.println("Testing method returns false");
|
||||
}
|
||||
}
|
||||
userInput = 0;
|
||||
}
|
||||
if (userInput == 2) {
|
||||
System.out.println("Selected \"Enter new array\"");
|
||||
int[][] newArray = inputArray();
|
||||
if (isConsecutiveFour(newArray)) {
|
||||
System.out.println("Testing method returns true");
|
||||
} else {
|
||||
System.out.println("Testing method returns false");
|
||||
}
|
||||
}
|
||||
} while (userInput != -1);
|
||||
System.exit(0);
|
||||
//printArray(intArray1);
|
||||
//System.out.println(isConsecutiveFour(intArray1));
|
||||
}
|
||||
|
||||
public static void printArray(int[][] array) {
|
||||
int rowCounter = 0;
|
||||
for (int x = 0; x < array.length; x++) {
|
||||
for (int y = 0; y < array[x].length; y++) {
|
||||
System.out.print(array[x][y] + " ");
|
||||
rowCounter++;
|
||||
if (rowCounter % (array.length + 1) == 0) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void printArray(int[] array) {
|
||||
for (int i : array) {
|
||||
System.out.print(i + " ");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isConsecutiveFour(int[][] values) {
|
||||
// Horizontal Checking
|
||||
System.out.println("Checking for Horizontal matches...");
|
||||
boolean horizontalTest = horizontalMatch(values);
|
||||
// Vertical Checking
|
||||
System.out.println("Checking for Vertical matches...");
|
||||
boolean verticalTest = verticalMatch(values);
|
||||
System.out.println("Checking for Diagonal matches...");
|
||||
boolean diagonalTest = diagonalMatch(values);
|
||||
if (horizontalTest || verticalTest || diagonalTest) {
|
||||
System.out.println("Match found!");
|
||||
return true;
|
||||
}
|
||||
System.out.println("No match found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean diagonalMatch(int[][] array) {
|
||||
for (int row = 0; row < array.length - 3; row++) {
|
||||
for (int col = 0; col < array[row].length - 3; col++) {
|
||||
// Check for four consecutive numbers diagonally from top-left to bottom-right
|
||||
if (array[row][col] == array[row + 1][col + 1] && array[row + 1][col + 1] == array[row + 2][col + 2]
|
||||
&& array[row + 2][col + 2] == array[row + 3][col + 3]) {
|
||||
System.out.println("Found four consecutive numbers diagonally at: " + row + "," + col);
|
||||
return true;
|
||||
}
|
||||
// Check for four consecutive numbers diagonally from top-right to bottom-left
|
||||
if (array[row][col + 3] == array[row + 1][col + 2] && array[row + 1][col + 2] == array[row + 2][col + 1]
|
||||
&& array[row + 2][col + 1] == array[row + 3][col]) {
|
||||
System.out.println("Found four consecutive numbers diagonally at: " + row + "," + (col + 3));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean verticalMatch(int[][] values) {
|
||||
int intCounter = 0, y = 0;
|
||||
for (int rowIterate = 0; rowIterate < values.length; ++rowIterate) {
|
||||
y = 0;
|
||||
for (int x = 0; x < values.length - 1; ++x) {
|
||||
++y;
|
||||
if (values[x][rowIterate] == values[y][rowIterate]) {
|
||||
intCounter++;
|
||||
System.out.println(values[x][rowIterate] + " " + values[y][rowIterate] + ", intCounter: " + intCounter);
|
||||
} else {
|
||||
intCounter = 0;
|
||||
System.out.println(values[x][rowIterate] + " " + values[y][rowIterate] + ", intCounter: " + intCounter);
|
||||
}
|
||||
if (intCounter == 3) {
|
||||
System.out.println("Vertical match!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
System.out.println("Checking next line...");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean horizontalMatch(int[][] values) {
|
||||
int intCounter = 0, y = 0;
|
||||
// Horizontal checking
|
||||
// If the same value has been observed 4 times, return true
|
||||
//System.out.println("values[0].length: " + values[0].length);
|
||||
//System.out.println("values.length: " + values.length);
|
||||
|
||||
for (int rowIterate = 0; rowIterate < values.length; ++rowIterate) {
|
||||
y = 0;
|
||||
for (int x = 0; x < values[0].length - 1; ++x) {
|
||||
++y;
|
||||
if (values[rowIterate][x] == values[rowIterate][y]) {
|
||||
intCounter++;
|
||||
System.out.println(values[rowIterate][x] + " " + values[rowIterate][y] + ", intCounter: " + intCounter);
|
||||
} else {
|
||||
intCounter = 0;
|
||||
System.out.println(values[rowIterate][x] + " " + values[rowIterate][y] + ", intCounter: " + intCounter);
|
||||
}
|
||||
if (intCounter == 3) {
|
||||
System.out.println("Horizontal match!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
System.out.println("Checking next line...");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.chloefontenot.mp1_chloefontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author chloe
|
||||
*/
|
||||
public class MarkouCode {
|
||||
|
||||
/**
|
||||
* Traverses the parm array diagonally from top left towards the top and prints the (i,j) indexes of the traversal.
|
||||
*
|
||||
* @param ar 2D array
|
||||
*/
|
||||
public static boolean topLeftTriangleDiagonalNothwest(int[][] ar) {
|
||||
System.out.println("diagonal indexes top-triangle of array ");
|
||||
int rowCount = 0;
|
||||
for (int columnCounter = 0; columnCounter < ar[0].length; ++columnCounter) {
|
||||
int i = 0;
|
||||
int j = columnCounter;
|
||||
int[] diagonalArray = new int[rowCount + 1];
|
||||
for (int diagonalCounter = 0; diagonalCounter <= rowCount; ++diagonalCounter) {
|
||||
diagonalArray[diagonalCounter] = ar[i][j];
|
||||
if (isConsecutiveFour(diagonalArray)) {
|
||||
return true;
|
||||
}
|
||||
System.out.print(i + "," + j + " ");
|
||||
++i;
|
||||
j--;
|
||||
if (i == ar.length | j == ar[0].length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
rowCount++;
|
||||
|
||||
System.out.println("");
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Traverses the parm array diagonally from bottom right towrads the to
|
||||
//and prints the (i,j) indexes of the traversal.
|
||||
|
||||
*
|
||||
* @param ar
|
||||
*/
|
||||
public static boolean bottomRightTriangleDiagonalNothwest(int[][] ar) {
|
||||
System.out.println("diagonal indexes bottom-triangle of array ");
|
||||
|
||||
int rowCount = 0;
|
||||
int numColumns = 0;
|
||||
int[] diagonalArray = new int[rowCount + 1];
|
||||
if (ar[0].length == ar.length)//square table
|
||||
{
|
||||
numColumns = ar[0].length - 1;
|
||||
} else if (ar[0].length > ar.length)//wide table
|
||||
{
|
||||
numColumns = ar.length - 1;
|
||||
} else //narrow-width rectangle array
|
||||
{
|
||||
numColumns = ar[0].length;
|
||||
}
|
||||
|
||||
for (int columnCounter = 0; columnCounter < numColumns; ++columnCounter) {
|
||||
int i = ar.length - 1;
|
||||
int j = ar[0].length - 1 - columnCounter;
|
||||
for (int diagonalCounter = 0; diagonalCounter <= rowCount; ++diagonalCounter) {
|
||||
|
||||
System.out.print(i + "," + j + " ");
|
||||
diagonalArray[diagonalCounter] = ar[i][j];
|
||||
if (isConsecutiveFour(diagonalArray)) {
|
||||
return true;
|
||||
}
|
||||
--i;
|
||||
j++;
|
||||
}
|
||||
rowCount++;
|
||||
System.out.println("");
|
||||
return false;
|
||||
}
|
||||
//middle chunk of narrow array
|
||||
|
||||
System.out.println("-----------------------");
|
||||
if (ar.length > ar[0].length) {
|
||||
System.out.println("diagonal indexes middle part of array when the array "
|
||||
+ "is narrow ");
|
||||
|
||||
for (int i = 1; i < ar.length - ar[0].length; ++i) {
|
||||
int rowIndex = i;
|
||||
int columnIndex = ar[0].length - 1;
|
||||
for (int j = 0; j < ar[0].length; ++j) {
|
||||
|
||||
System.out.print(rowIndex + "," + columnIndex + " ");
|
||||
diagonalArray[diagonalCounter] = ar[i][j];
|
||||
if (isConsecutiveFour(diagonalArray)) {
|
||||
return true;
|
||||
}
|
||||
rowIndex++;
|
||||
columnIndex--;
|
||||
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean isConsecutiveFour(int[][] values) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isConsecutiveFour(int[] values) {
|
||||
for (int i = 0; i < values.length - 4; ++i) {
|
||||
if (values[i] == values[i + 1]
|
||||
&& values[i + 1] == values[i + 2]
|
||||
&& values[i + 2] == values[i + 3]) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void printIndexesDiagonally(int ar[][]) {
|
||||
topLeftTriangleDiagonalNothwest(ar);
|
||||
System.out.println("------------------------");
|
||||
bottomRightTriangleDiagonalNothwest(ar);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int[][] ar1
|
||||
= {
|
||||
{
|
||||
1, 1, 1, 1, 8
|
||||
},
|
||||
{
|
||||
1, 1, 1, 8, 9
|
||||
},
|
||||
{
|
||||
1, 1, 8, 1, 9
|
||||
},
|
||||
{
|
||||
1, 8, 1, 3, 2
|
||||
},};
|
||||
|
||||
int[][] ar2
|
||||
= {
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1
|
||||
},};
|
||||
|
||||
int[][] ar3
|
||||
= {
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},
|
||||
{
|
||||
1, 1, 1
|
||||
},};
|
||||
System.out.println(topLeftTriangleDiagonalNothwest(ar1));
|
||||
/*
|
||||
System.out.println("SQUARE array of size 4x4");
|
||||
printIndexesDiagonally(ar1);
|
||||
|
||||
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
System.out.println("\nWIDE array of size 8x5");
|
||||
printIndexesDiagonally(ar2);
|
||||
|
||||
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
|
||||
System.out.println("\nNARROW array of size 10x3");
|
||||
printIndexesDiagonally(ar3);
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user