Is it possible to build a Binary tree in an interpreted language without pointers?
All you're really doing is building a large struct
Of course it is. A big list is the memory space and an integer index in that list the memory pointer.
Yes.
>>58629000
>without pointers
Most possibly you won't be able to place pointers in array in an interpreted language directly, so you kinda won't have pointers in the array, but it's just you won't be able to use pointers as pointers.
yes it is. You can simulate pointers using any array.
You don't need pointers to make binary tree.
data Tree a = Empty | a (Tree a) (Tree a)
There, recursively defined binary tree in Haskell.
>>58629685
Fail
>>58629697
How about providing some constructive criticism instead of a 9gag-tier reply?
>>58629000
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15
16... and so on
just use these indices in a large array.
The father of a node x is x/2 rounded down (or simply a right shift), the two children of node x are 2x and 2x+1 (left shift filling 0 or 1).
You just need a node structure that records if a node is in the tree or not.
>>58629000
>interpreted language without pointers?
What interpreted language doesn't have pointers? (protip: references are pointers)
Also, this: >>58629657
You can represent a binary tree in an array, for example.