Skip to main content
deleted 139 characters in body
Source Link

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

What is the fastest deterministic algorithm for this problem?
Can it be solved faster than sorting them? Can this problem be solved in deterministic linear time?

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

What is the fastest deterministic algorithm for this problem?
Can it be solved faster than sorting them? Can this problem be solved in deterministic linear time?

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

What is the fastest deterministic algorithm for this problem?
Can it be solved faster than sorting them? Can this problem be solved in deterministic linear time?

deleted 62 characters in body
Source Link

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

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

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

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

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

What is the fastest deterministic algorithm for this problem?
Can it be solved faster than sorting them? Can this problem be solved in deterministic linear time?

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

deleted 306 characters in body
Source Link

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

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

The answers below conclusively answer this question for many popular models, but not the right one. I'm not an expert on models, but consider the statement "It has not been proven if (some) NP problems require more than O(n) time". If they were using the model of Yuval's popular answer below usinglooking for: the comparisonTuring machine model, that statement would be wrong, but the statement is considered correct. So what model are they using when they say that?

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

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

The answers below conclusively answer this question for many popular models, but not the right one. I'm not an expert on models, but consider the statement "It has not been proven if (some) NP problems require more than O(n) time". If they were using the model of Yuval's popular answer below using the comparison model, that statement would be wrong, but the statement is considered correct. So what model are they using when they say that?

Consider the following problem:

Input: two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order.

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

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

The answers below conclusively answer this question for many popular models, but not the one I'm looking for: the Turing machine model.

clarification about models.
Source Link
Loading
added 1 character in body
Source Link
Loading
added 233 characters in body
Source Link
Loading
added 40 characters in body
Source Link
Loading
added 71 characters in body
Source Link
Loading
edited tags
Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393
Loading
Improve problem statement, to make it reflect the original intent more closely. Add tag.
Source Link
D.W.
  • 165.6k
  • 21
  • 230
  • 490
Loading
deleted 85 characters in body; edited tags; edited title
Source Link
Kaveh
  • 22.5k
  • 4
  • 52
  • 112
Loading
Tweeted twitter.com/StackCompSci/status/684113182617632770
improved presentation
Source Link
Juho
  • 22.8k
  • 7
  • 62
  • 117
Loading
edited body
Source Link
Loading
Source Link
Loading