Derive a lower bound to search for all occurrences of a given list of n numbers in another list of n numbers by comparisons.
since we have to find total occurrences of every number in list1
in list2
to check each element in list1 we need a loop which runs n
times
and to find all occurrences of the element in list1 in list2, we
need another loop which is nested under above loop, since list2 has
n elements, it will also run for n times
hence total complexity would be :n*n
so, lower bound : Omega(n^2)
Derive a lower bound to search for all occurrences of a given list of n numbers...