这个代码行在这个包合并算法中意味着什么?

use*_*711 -1 algorithm

我找到了一个算法Package-Merge

Algorithm(I, X) {
    S is empty;
    for all d, Ld list of items having width 2^d;
    while X > 0 loop 
        minwidth = the smallest term in diadic expansion of X; 
        if I=0 then //is empty 
            return “No solution.” ; 
        else 
            d=the minimum such that L is not empty;
            r=2^d; 
            if r > minwidth then 
                return “No solution.”
            else if r = minwidth then 
                Delete the minimum weight ; 
                X= X - minwidth ;
            end if 
            Pd+1=PACKAGE(Ld) ;
            discard Ld ; 
            Ld+l=MERGE(pd+1,Ld+1);
        end if 
    end loop 
    return “S is the optimal solution.”
}
Run Code Online (Sandbox Code Playgroud)

我对算法有一些疑问.什么是Ld + 1?为什么我们丢弃Ld时它可能有一个硬币,其价值= r时的最小宽度

Rob*_*vey 5

实际上是Ld + 1

L d + 1

请参阅此处(最佳长度限制霍夫曼码的快速算法)

它表示该位置的列表条目d+1.因此,如果d == 5,那么它是第六个列表条目.