An expression tree’s nodes can be deleted by calling?

Category: QuestionsAn expression tree’s nodes can be deleted by calling?
Editor">Editor Staff asked 5 months ago

An expression tree’s nodes can be deleted by calling?
 
(a) malloc
 
(b) calloc
 
(c) delete
 
(d) free
 
Origin of the question is Trees topic in division Trees of Data Structures & Algorithms I
 
I have been asked this question in examination.

1 Answers
Editor">Editor Staff answered 5 months ago

Right answer is (d) free
 
Easiest explanation – In Binary trees, nodes are created by calling malloc and they are deleted by calling free.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702