Leetcode 0094. Binary Tree Inorder Traversal

Posted on Sun 29 September 2024 in Leetcode • Tagged with binary-tree-traversal-inorder

Question Link : https://leetcode.com/problems/binary-tree-inorder-traversal/

Difficulty: Easy

Premium: False

Question

Given the root of a binary tree, return the inorder traversal of its nodes' values.   Example 1:

Input: root = [1,null,2,3] Output: [1,3,2] Explanation:

Example 2:

Input: root = [1,2,3,4,5,null …


Continue reading

Leetcode 0501. Find Mode in Binary Search Tree

Posted on Sun 22 September 2024 in Leetcode • Tagged with bst, binary-tree-traversal-inorder, dfs

Question Link : https://leetcode.com/problems/find-mode-in-binary-search-tree/

Difficulty: Easy

Premium: False

Question

Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it. If the tree has more than one mode, return them in any order …


Continue reading