abcdrm
V2EX  ›  问与答

刚开始学算法,遇到一个不是很理解的算法,求解读详细的运行过程,或者举个例子啥的

  •  
  •   abcdrm · Mar 30, 2016 · 2086 views
    This topic created in 3699 days ago, the information mentioned may be changed or developed.
    Algorithm15: split-I(𝑙𝑖𝑠𝑡)
    Requires : a list 𝒍𝒊𝒔𝒕;
    Returns : a pair of shorter lists 𝑙𝑖𝑠𝑡1 and 𝑙𝑖𝑠𝑡2 that contain the same elements as list.
    1: if isEmpty(𝒍𝒊𝒔𝒕) then
    2: return (Nil, Nil)
    3: else
    4: let (𝐿1, 𝐿2) = split-I(tail(𝒍𝒊𝒔𝒕))
    5: return (Cons(value(list), 𝐿2), 𝐿1)
    6: endif
    1 replies    2016-03-30 14:32:31 +08:00
    fengyunSmlie
        1
    fengyunSmlie  
       Mar 30, 2016
    一堆这个𝒍𝒊𝒔𝒕 无力。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   986 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 19:12 · PVG 03:12 · LAX 12:12 · JFK 15:12
    ♥ Do have faith in what you're doing.