public class ArrayOps extends Object
Constructor and Description |
---|
ArrayOps() |
Modifier and Type | Method and Description |
---|---|
static int[] |
copy(int[] nums)
#12 Make and return a copy of the array nums.
|
static int |
findIndex(double[] nums,
double val)
#5 Find the index of a specific value in an array of integers.
|
static int |
findLargest(double[] A)
#1 Find the index of the Lagest value
|
static int |
findLargest(double[] A,
int boundary)
#1 Find the index of the Lagest value
|
static double |
findMax(double[] nums)
#1 Find the largest value in an array of integers.
|
static String |
findMax(String[] strs)
#2 Find the largest value in an array of Strings.
|
static int |
findMin(int[] nums)
#3 Find the smallest value in an array of integers.
|
static String |
findMin(String[] strs)
#4 Find the smallest value in an array of Strings.
|
static int |
findSmallest(double[] A)
#1 Find the index of the Smallest value
|
static int |
findSmallest(double[] A,
int boundary)
#1 Find the index of the Smallest value
|
static int |
findVal(String[] strs,
String str)
#6 Find the index of a specific value in an array of Strings.
|
static void |
insert(int[] nums,
int index,
int val)
#10 Insert val into nums at the specified index.
|
static int |
product(int[] nums)
#8 Compute and return the product of all of the elements of nums.
|
static void |
remove(int[] nums,
int index)
#9 Remove from nums the value at the specified index.
|
static double[] |
Sort(double[] unsorted)
Sort array
|
static int |
sum(int[] nums)
#7 Compute and return the sum of all of the elements of nums.
|
static void |
swapElements(int[] nums,
int i,
int j)
#11 Swap the element at index i of nums with the element at index j.
|
public static int findLargest(double[] A)
nums
- an array of integers.public static int findLargest(double[] A, int boundary)
nums
- an array of integers.public static int findSmallest(double[] A)
nums
- an array of integers.public static int findSmallest(double[] A, int boundary)
nums
- an array of integers.public static double[] Sort(double[] unsorted)
nums
- an array of integers.public static double findMax(double[] nums)
nums
- an array of integers.public static String findMax(String[] strs)
strs
- an array of Strings.public static int findMin(int[] nums)
nums
- an array of integers.public static String findMin(String[] strs)
strs
- an array of Strings.public static int findIndex(double[] nums, double val)
nums
- an array of doublesval
- the value to search for in nums.public static int findVal(String[] strs, String str)
strs
- an array of Strings.str
- the value to search for in strs.public static int sum(int[] nums)
nums
- an array of integers.public static int product(int[] nums)
nums
- an array of integers.public static void remove(int[] nums, int index)
nums
- an array of integers.index
- the index of the value to remove from nums.public static void insert(int[] nums, int index, int val)
nums
- an array of integers.index
- the index at which val is to be inserted.val
- the value to be inserted into nums.public static void swapElements(int[] nums, int i, int j)
nums
- an array of integers.i
- index of the first number to be swapped.j
- index of the second number to be swapped.public static int[] copy(int[] nums)
nums
- an array of integersJas4pp 1.5 © Java Analysis Studio for Particle Physics