Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[931198]: wavelets / private / deleteSubtree.m Maximize Restore History

Download this file

deleteSubtree.m    9 lines (8 with data), 269 Bytes

1
2
3
4
5
6
7
8
9
function wt = deleteSubtree(nodeNo,wt)
toDelete = nodeSubtreeBF(nodeNo,wt);
for ii = length(toDelete):-1:1
wt = deleteNode(toDelete(ii),wt);
biggerIdx = find(toDelete>toDelete(ii));
toDelete(biggerIdx) = toDelete(biggerIdx) - 1;
end
wt = deleteNode(nodeNo,wt);