Skip to main content
4 of 15
deleted 85 characters in body; edited tags; edited title
Kaveh
  • 22.5k
  • 4
  • 52
  • 112

Determinsitic linear time algorithm to check if two given arrays contain the same items

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$.

Query: does $A$ and $B$ contain the same items (with their multiplicity)?

What is the fastest deterministic algorithm for this problem?
Can be it solved faster than sorting them ($O(n \lg n))$?
Can this problem be solved in deterministic linear time?