Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21dd5bdbc9b77be

Jump to content

Talk:Element distinctness problem

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 8 years ago by Deeparnab

In the "Generalization: Finding Repeated Elements" section, third paragraph, it states "The above algorithms rely only on the test of identity of the elements." This line seems ambiguous. Do we mean that we can only make equality queries of the form (A[i] =? A[j])? Then we do *not* have an O(n log(k)) algorithm. The O(n log k) algorithms need to be able to do a binary search in a sorted data structure. Indeed, I think with only equality queries the element distinctness problem needs all pairs to be queried. Deeparnab (talk) 00:47, 12 December 2017 (UTC)DeeparnabReply

Hm, I dont really get it... Using a hashtable of the elements I could take each element (O(n)) and check it against the hashtable (O(1)) and setting up the hashtable is again n times O(1) so I have n+n+1 = O(n) ...

Yes, that's what the last sentence of the second paragraph says. But nevertheless, it's harder in certain standard models of computation. —David Eppstein (talk) 15:23, 9 May 2012 (UTC)Reply