Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 501. Find Mode in Binary Search Tree
Given a BST that may contain duplicate values, return all value(s) that occur most frequently (the mode(s)) in the tree. The key insight is that the BST's sorted order makes equal values consecutive (so an inorder traversal — even in O(1) extra space via Morris traversal for the follow-up — lets you count runs efficiently).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.