I am stuck, I know how binary tree works, but I don't have any clue how to add data recursively in a binary tree.
The user needs to enter a formula with logical operators.
If the user presses to a button e.g NOT(unary operator), then it should display at follow : NOT(...)
Then instead of the 3 dots the user can enter manually a letter "b" or another operator by pressing any of the button (e.g AND) which is a binary operator.
NOT ( (...) AND (...)), then again the user have the choice to enter a letter or to press another button on the left hand-side and then on the right hand-side of the AND connector. NOT ( ( b ) AND ( a )).
This formula is terminated has AND is the root. and b and a are leaves.
but i dont know how to code this in java.
NEED HELP please i am struggling for almost 2 weeks