NevemTeve
2024.05.20
|
|
0 0
162
|
Ahol lista van, ott bináris fa is lehet, pl.:
vabcde = eabcd
{emptree} = vf000 {notemptree} = T{sel1of4} {isemptree} = B{not}{notemptree} {value} = T{sef2of4} {left} = T{sel3of4} {right} = T{sel4of4} {leftemptree} = B{isemptree}{left} {rightemptree} = B{isemptree}{right} {isleaf}x = {and}({leftemptree}x)({rightemptree}x)
{setvalue}{tree}{val} = vt{val}({left}{tree})({right}{tree}) {setleft}{tree}{subtree} = vt({value}{tree}){subtree}({right}{tree}) {setright}{tree}[subtree} = vt({value}{tree})({left}{tree}){subtree}
{inorder}x = ({isemptree}x){empty}( {concat} ({append}({inorder}({left}x)({value}x)) ({inorder}({right}x)) ) |
Előzmény: NevemTeve (160)
|
|