V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
abcdrm
V2EX  ›  问与答

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

  •  
  •   abcdrm · 2016-03-30 13:12:31 +08:00 · 1348 次点击
    这是一个创建于 2948 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 条回复    2016-03-30 14:32:31 +08:00
    fengyunSmlie
        1
    fengyunSmlie  
       2016-03-30 14:32:31 +08:00
    一堆这个𝒍𝒊𝒔𝒕 无力。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   995 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:13 · PVG 04:13 · LAX 13:13 · JFK 16:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.