1
$\begingroup$

A DeBruijnSequence of order $n$ on a list of length $k$ is a cyclic sequence of length in which every possible block of length $n$ taken from the list occurs exactly once as a contiguous subsequence.

What algorithm(s) does DeBruijnSequence use? Why does this function run so fast even for large parameters?

Below links may help:

$\endgroup$
2
  • 2
    $\begingroup$ Evaluate GeneralUtilities`PrintDefinitions[DeBruijnSequence], and you will se the code behind. $\endgroup$ Commented Aug 21 at 7:08
  • 1
    $\begingroup$ Following up on that, it seems to be driven by Language`NumbersDump`deBruijnSequencePositions which is actually a rather simple CompiledFunction that you can inspect. It appears to just be the came as the C++ implementation from Rosetta Code $\endgroup$ Commented Aug 21 at 17:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.