language agnostic - Non-recursive algorithms for ordered traversing -


Based on the following techniques, there is a family of connective algorithms - we inspect some assets of the structure and use that property Without the linear, then without the linear time is the time for all possible / accessible variations (or closing, which really does not matter),

example

Lexicographic Permutation a .. a [n]

  • Find previous [k] such as [k]
  • Find [K + 1] in the minimum [M]. An [N] is such that [k] A [M]
  • Swap [M] and [K]
  • Reject one's [1]. A [n]

    n-k-subset

    • Repeat from the end, first get zero, first 1 (first Count a [k] == 0 as [k1] one. [N]
    • rebelance - 1]
    • a [k] = 1 <
    • The division of n (in descending order)

      • First Kashmir like [k]
      • Increase a [k] = a [k] + 1
      • The number of elements of Kashmir is the last one < / Li>
      • Allows left neighbors as long as 1.

        I think it is enough to clarify the nature of such algorithms, and some other examples can be found in excellent, magnificent "book."

        My question is the following: In any field of this kind of algorithm, please, please describe me more examples. If you also provide algorithms themselves, then it will be great (in words, above Way, better). Reference to books Bh, the article is also welcome References to related theoretical issues are also welcome (for example, I do not feel like when such algorithms can be created and when -)

        Thanks in advance.

        Consider an algorithm from a family of algorithms. E either is already repeated, or if it is recursive, then it can be converted into a similar repeated algorithm by imitating the calling stack by a clear data structure. look at the example .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -