O(n) is the worst-case performance of the add method in a binary search tree with linked nodes.
What is binary search tree?
- A binary search tree (BST), also known as an ordered binary tree or a sorted binary tree in computer science, is a rooted binary tree data structure where each internal node's key is greater than all the keys in the corresponding node's left subtree and less than all the keys in the corresponding node's right subtree.
- The height of the tree has a direct correlation with how time-consuming operations on it are.
- Binary search is made possible by binary search trees, which make it quick to look up, add, and remove data objects.
The lookup performance of a BST is proportional to the binary logarithm because the nodes are arranged so that each comparison skips around half of the remaining tree.
Know more about binary search tree with the help of the given link:
https://brainly.com/question/12946457
#SPJ4