-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.java
More file actions
41 lines (37 loc) · 1.28 KB
/
Util.java
File metadata and controls
41 lines (37 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Static class of utility methods.
*
* @author @gcschmit
* @version 02jun2020
*/
public class Util
{
/*
* Returns a random integer between m (inclusive) and n (exclusive) [m, n)
*
* @param m low-end of range
* @param n high-end of range
* @return a random integer between m (inclusive) and n (exclusive) [m, n)
*/
static int randRange(int m, int n)
{
// TODO
return 0;
}
/**
* Returns the number of times that the specified value occurs in the specified array
* between the specified start index (inclusive) and the specified end index (exclusive).
*
* @param array the array in which to count the occurrences of the specified value
* @param value the value for which to count occurrences in the specified array
* @param start the index at which to start counting occurrences (inclusive)
* @param end the index at which to end counting occurrences (exclusive)
* @return the number of occurrences of the specified value in the specified array between
* the specified start index and specified end index
*/
static int count(int[] array, int value, int start, int end)
{
// TODO
return 0;
}
}