V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
abcdrm
V2EX  ›  问与答

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

  •  
  •   abcdrm · Mar 30, 2016 · 2042 views
    This topic created in 3681 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   ·   3399 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:24 · PVG 20:24 · LAX 05:24 · JFK 08:24
    ♥ Do have faith in what you're doing.