Let us add the words to the bunary search tree with the condition of using alphabetic order of letters in case of any clashes
/ \ / \
Envy Greed. Pride Wrath
Lust is the root.
Gluttony start s with g<l so it becomes left child.
Greed has second letter r>l so it becomes right child of gluttony.
Sloth has s>l of lust hence it is right child of list.
Wrath has w>s hence its right child of sloth.
Envy has e<g hence its left child if gluttony.
Pride has p>l of list but p<s of sloth hence it becomes left child of sloth.
Content will be erased after question is completed.
Enter the email address associated with your account, and we will email you a link to reset your password.
Forgot your password?