Arrays.fill complexity in java -
how arrays.fill(char[] a,char val)
implemented internally in java
?
and complexity of it?
if definition of fill(char[] a, char val)
available in java.util.arrays
class.
it such this
public static void fill(object[] a, object val) { (int = 0, len = a.length; < len; i++) //this loop continues length of a. a[i] = val; }
so, complexity method o(n)
. n
length of object array object[] a
passed parameter.
Comments
Post a Comment