And a standard heap selection algorithm won't
work?

The basic algorithm is (assuming that
`k`

is the number of items you want to
select)

```
create an empty min-heap
for each node (depth-first search)
if heap.count < k
heap.Add(node)
else if node.Value < heap.Peek.Value()
heap.RemoveSmallest()
heap.Add(node)
```

When the `for`

loop is done, your
heap contains the `k`

largest values.
You can obtain them in ascending order with:

```
while heap.count > 0
output (heap.RemoveSmallest().Value)
```

If you want them in ascending order, remove
them from the heap as above into an array, and
then reverse the array.

This algorithm is O(n log k), where
`n`

is the number of nodes in the tree,
and `k`

is the number of items you
want.