# | Title | Solution | Time | Space | Difficulty | Note |
938 | O(n) | O(h) | Easy | BST, DFS, BFS | ||
108 | O(n) | O(log(n)) | Easy | Recursion | ||
110 | O(n) | O(h) | Easy | Recursion | ||
220 | O(n log(k)) | O(k) | Hard | Binary Search Tree | ||
235 | O(h) | O(1) | Medium | Binary Search Tree | ||
703 | O(n log(k)) | O(k) | Easy | Binary Heap | ||
450 | O(h) | O(1) | Medium | Binary Search Tree | ||
701 | O(h) | O(1) | Medium | Tree, BST | ||
700 | O(h) | O(1) | Easy | Tree, BST | ||
173 | O(1), amortized | O(h) | Medium | Design | ||
285 | O(h) | O(1) | Medium | Premium, Binary Search Tree | ||
98 | O(n) | O(h) | Medium | Recursion |
#285) Given the root of a binary search tree and a node p in it, return the in-order successor of that node in the BST. If the given node has no in-order successor in the tree, return null.
The successor of a node p is the node with the smallest key greater than p.val.