I just wanted to find out whether it is possible to implement a binary tree data structure in thunkable x, to find out the possibilities to use thunkable in higher classes in schools for computer science courses.
I constructed nodes for the binary tree with objects that have three components: a content, the link to the left subtree the link to the right subtree.
When I give the app a self constructed tree by “when screen starts…” then the output function works well.
So there seems to be no mistake.
But the input function seems not to work.
My idea: Give the intree function a tree and a content as parameters. If the tree is empty then create a new node with content and two empty subtrees.
If not, call the function recursively to the left subtree (if cont is smaller) or to the right subtree.
But after inserting numbers, the always are attached to the right subtree.
Where is my mistake?