Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2018-12-stringbeginners-in-place-array-rotation

kgoto
December 07, 2018

 2018-12-stringbeginners-in-place-array-rotation

配列のローテーションを線形時間でin-placeに実行せよ
StringBeginners: https://sites.google.com/view/stringbeginners/workshop/2018/2018-12-07-aip

kgoto

December 07, 2018
Tweet

More Decks by kgoto

Other Decks in Research

Transcript

  1. 0 -
    2 0 00 2
    / 1 1

    View full-size slide

  2. f
    n n - . j C A
    - . - . o]
    s i r : r e]
    [ i : - . - . pA

    n B=
    n o] a B=
    +( - . ,( - .



    + 1
    1

    View full-size slide

  3. C

    n = A > .
    n 1 <
    p . >
    p + B >

    +

    +

    View full-size slide


  4. n
    p a
    p a
    p
    n
    p C
    p a
    p

    View full-size slide

  5. ae
    n o - . fi B C
    - . - . n ]
    j
    ] [j - . - . - . - .

    n = A
    n n ] A
    +( - . ,( - .



    + 1
    1

    View full-size slide

  6. A3

    n 1
    n
    1 C B 2




    ,
    ,

    View full-size slide

  7. n B C
    B B = A
    C
    I H
    ,-8 -, ,-
    9, , , 78 , -1

    View full-size slide