Usually we use the tree data structure when we care about time complexity for ins/del/…
-In this special case problem, space saving is mandatory too that is 2 pointers for each node is unaffordable; actual data are in leaves so infact even the internal nodes are considered overhead
-So, I thought of storing it as a 2D array with variable row size, we can assume the tree is almost always full complete power of 2, something like
R= N leaf nodes
R= N/2 level-1 nodes
R= N/4 nodes
-I can derive the formulas for del/ins/… as the tree is easily mind-vewable from this presentation, without any pointers at all.
-Now, did I miss something???
-Is there any flaw in this?
-I’m checking for brainstorming or some opinions.