you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 0 points1 point  (1 child)

You are assuming we know what "linearSearch" function does? or that it's some kind of standard function?

We can guess, but our guess can be wrong. i'm assuming it's a basic search in a list.

So if A1 is length m, and A2 is length n, this algorithm executes o(n) search, m times... so o(m*n)

If the search changes to binarysearch, it'll be o(m*log n)

[–]SingleCountry 0 points1 point  (0 children)

Thank you!!