public class Tables
extends java.lang.Object
Constructor and Description |
---|
Tables() |
Modifier and Type | Method and Description |
---|---|
static int |
binarySearch(int[] tbl,
int schElement)
Binary search in an one dimension array of integers to find a specific value
|
static int |
cntOccurances(int[] t,
int sE)
Counts the number of occurances of a specific value in an one dimension array of integers
|
static boolean |
equals(int[] tA,
int[] tB)
Compares for equality between two (one-dimensional) arrays of integers.
|
static boolean |
equals(java.lang.String[] tA,
java.lang.String[] tB)
Compares for equality between two (one-dimensional) arrays of Strings.
|
static void |
main(java.lang.String[] args) |
static int |
max(int[] t)
Search for the max element in an integer array
|
static void |
print(int[] array)
Prints the contents of a one dimension array of chars in one line seperated each other by a space character
|
static void |
println(int[] array)
Prints the contents of a one dimension array of chars in one line seperated each other by a space character.
|
static int[] |
reverse(int[] input)
Produces a reversed array
|
static int |
seqSearch(int[] t,
int sE)
Sequential search in an one dimension array of integers to find a specific value
|
static int |
seqSearch(java.lang.String[] t,
java.lang.String sE)
Sequential search in an one dimension array of Strings to find a specific value
|
static void |
sort(int[] array)
Ταξινόμηση κατα αύξουσα σειρά ενός μονοδιάστατου πίνακα ακεραίων.
|
static int |
sum(int[] t)
Calculates the sum of all elements of a one-dimension int array
|
public static int seqSearch(int[] t, int sE)
t
- The array to be searchedsE
- The search elementpublic static int seqSearch(java.lang.String[] t, java.lang.String sE)
t
- The array to be searchedsE
- The search elementpublic static int cntOccurances(int[] t, int sE)
t
- The array to be searchedsE
- The search elementpublic static void print(int[] array)
array
- The array to be printedpublic static void println(int[] array)
array
- The array to be printedpublic static int[] reverse(int[] input)
input
- The table whose inverted copy we ask forpublic static int sum(int[] t)
t
- The array of which we request the sum of its elementspublic static int max(int[] t)
t
- The input arraypublic static boolean equals(int[] tA, int[] tB)
tA
- The first array of integerstB
- The second array of integerspublic static boolean equals(java.lang.String[] tA, java.lang.String[] tB)
tA
- The first array of StringstB
- The second array of Stringspublic static int binarySearch(int[] tbl, int schElement)
tbl
- The array to be searched. Array t should be sorted in the responsibility of application,
otherwise binarySearch would end up returning a wrong resultschElement
- The search elementpublic static void sort(int[] array)
array
- Ο πίνακας που θα ταξινομηθείpublic static void main(java.lang.String[] args)