Search Range in Binary Search Tree
You should change searchRange to search_range as per PEP8, Python's style guide.
If this is Python2 then you should use Solution(object). (This is why we have version tags).
res should go in the function. As per RobertB's comment.
Just call searchRange twice and you will clearly see why.
root, k1 and k2 are all bad names.
Rename them to better ones.
E.G. node, minimum and maximum, respectively.
You should use k1 &lt;= root.val &lt;= k2 instead of root.val &gt;= k1 and root.val &lt;= k2.
There is currently no need to return []. return None or any return work as well.
If you wrap searchRange in another function, it can be much simpler.


If I were to do most of the above. (I didn't put it in a class.)

def search_range(root, minimum, maximum):
    nodes = []

    def recursive_search(node):
        if node is None:
            return None

        if node.val &gt; minimum:
            recursive_search(node.left)
        if minimum &lt;= node.val &lt;= maximum:
            nodes.append(node.val)
        if node.val &lt; maximum:
            recursive_search(node.right)

    recursive_search(root)
    return nodes