Binary tree's are really handy data structures. However, it can get confusing and cumbersome to write and use one if you don't have a solid foundation. Here's one written by myself with the assistance of AI, ChatGPT-4 by OpenAI.
I started with a basic struct and an empty insert function and asked it to complete the function (validated the code was proper) and then asked it to implement the rest of the algorithms, search, update, delete.
Our days are numbered...
/F