English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what happens if you delete
the root of binary tree without deleting the nodes?

2006-10-13 18:28:23 · 2 answers · asked by jasmine 3 in Computers & Internet Programming & Design

2 answers

Well theoretically the nodes still exist, but no way to reference them unless you had saved a link to them directly w/o having gone through the root

2006-10-13 18:31:20 · answer #1 · answered by shadowkat 5 · 0 0

shadowkat is right, u dont know where they are unless u have saved their address. So u have essentially deleted only the root of ur binary tree. althought they still exist in the RAM, infact in the data-segment, they will be erased once your program quits.... data segment will be flushed...... but its always a good habit to manually free any memory that u used in the program....

2006-10-13 18:55:18 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers