codesONLY / JavaScriptONLY

Knowledge Resource of core fundamentals of JavaScript explained in simple way!
378 stars 182 forks source link

Find Mode in Binary Search Tree.js #70

Closed DEV-AB-03 closed 2 years ago

DEV-AB-03 commented 2 years ago

Here I have proposed the solution for one of the most famous interview questions asked in the "FAANG" companies in Binary Search Trees Data Structure which is for finding the "Mode" in a given BST. Here I have used "Depth First Search" traversal technique and "Hashing" to store the Nodes Values in a Map and then retrieve the Node Value having highest frequency.

sohamsshah commented 2 years ago

LGTM!