ALGORITHMS & ENERGY
HOME
ABOUT
Same Values Squared
Has every value in the first array its corresponding value squared in the second array?
E.g. [2,1,3,4] and [16,4,1,9] return true
→ Generate random arrays
About 50% of the cases will be true, 25% will be false because of difference in array length, 25% will be false because the values don't match. Be patient. Calculation time can be up to several minutes for long arrays.
array length till 10,000 =>
array length till 100,000 =>
array length till 500,000 =>
array length till 1,000,000 =>
→ Or pass in your two arrays
=>
Algorithm
Result
Calculation Time
Relative Speed
'naive' algorithm
ms
'fast' algorithm
ms
↿
⇃
The length of the first array is:
0
The length of the second array is:
0
This is the first array:
[]
↿
⇃
This is the second array:
[]
↿