Please order the function belows by growth rate from fastest to slowest:
n^10
2^n
nlog(n)
10^6
And my answer is:
2^n
n^10
nlog(n)
10^6
Is my answer correct?
I was given a task. Write an algorithm so that, the input of 2 lists of data, will have at least one in common.
So, this is my algorithm: (I write the code in php)
$arrayA = array('5', '6', '1', '2', '7');
$arrayB = array('9', '2', '1', '8', '3');
$arrayC = array();
foreach($arrayA as $val){
if(in_array($val, $arrayB)){
…