Range Sum of a BST

Easy · Binary Search Trees · about 10 minutes

Asked at Meta, Google, Amazon.

Add up the values of all nodes in a binary search tree that lie between low and high, both ends included (low <= high).

Related guides