Skip to content

return wrong results when calling get() function after removing operation #5

@jizhihang

Description

@jizhihang

t = tree('root');
[ t node1 ] = t.addnode(1, 'Node 1'); %% attach to root
% node1 now contains the index of the first node.
[ t node2 ] = t.addnode(1, 'Node 2'); %% attach to root
[ t node11 ] = t.addnode(node1, 'Child of node 1'); %% attach to first node
disp(t.tostring)
t=t.removenode(node1);
disp(t.tostring);

t.get(1)
t.get(node2) // wrong result return!
I expected the result of get(node2) is 'Node 2', but get the 'Child of node 1'! why???
where is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions