Question
The language is Java, Need help changing my One-dimensional array to a two-dimensional array import java.util.Arrays; import java.util.Random; public class ArrayReview { private int[] array;
The language is Java, Need help changing my One-dimensional array to a two-dimensional array
import java.util.Arrays; import java.util.Random;
public class ArrayReview { private int[] array; public ArrayReview(int length) { Random r = new Random(100); array = new int[length]; for(int i =0 ;i public void setArray(int[] array) { this.array = array; } public void setKthItem(int k, int item) { array[k] = item; } public int pickMaxIndex( int start, int end) { int max = array[start]; int index=start; for(int i = start + 1 ;i< end ;i++) { if(array[i] >= max) { max = array[i]; index=i; } } return index; } public void swap(int i , int j) { int temp = array[i]; array[i] = array[j]; array[j] = temp; } public void selectSort() { int max;int pos; for(int i = 0;i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started