put_label/5¶
put_label(+ Index, + OldTree, + Label, - NewTree)*
constructs a new tree the same shape as the old which moreover has the same elements except that the Index-th one is Label.
It constructs a new tree the same shape as the old which moreover has the same elements except that the Index-th one is Label. Unlike the "arrays" of Arrays.Pl, OldTree is not modified and you can hang on to it as long as you please. Note that O(lg N) new space is needed.