DEV Community

Mujahida Joynab
Mujahida Joynab

Posted on

How to handle duplicate in BST

In BST , Left node values are less the than root node and right node values are greater than the root node .

So , What will happen if the value is equal to the root node?

The equal values can not be inserted in BST . Because it will create a problem in BST . We will just count root node 2 times using pair .

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay