Sail E0 Webinar
Question
If the tree is not a complete binary tree then what changes can be made for easy access of children of a node in the array ?
Options:
A .  every node stores data saying which of its children exist in the array
B .  no need of any changes continue with 2w and 2w+1, if node is at i
C .  keep a seperate table telling children of a node
D .  use another array parallel to the array with tree
Answer: Option A


Array cannot represent arbitrary shaped trees it can only be used in case of complete trees hence option a must be done which is one of several ways to use array in such situations.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers