Category: DFS
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. You may assume k is always valid, 1 ≤ k ≤ BST’s …
You are given a data structu re of employee information, which includes the employee’s unique id, his importance value and his direct subordinates’ id. For example, employee 1 is …
Given a binary search tree and a target, find out if there are any two numbers in the BST that sums up to this target. Given a Binary Search …
Given a BST (Binary Search Tree) with duplicates, find its mode(s) – the most frequently occurred element. A BST has the following characteristics: The left subtree of a node …
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create. …