Skip to content
Get started

How many heaps of seven keys

MediumCombinatorics5 min

The keys 1,2,…,71, 2, \dots, 7 are stored in a complete binary tree with 77 nodes (a root, two children, four grandchildren) so that every parent holds a smaller key than its children (a min-heap). How many different valid placements are there?

Show hints (2)+
  1. Which key must be at the root?
  2. Choose the key set of the left subtree; each subtree is then its own small heap.

Answer

Reveal answer →

80

Create a free account to see the full worked solution and track your progress.

Interview format: Prop Trading, Systematic & Data-Driven Trading

Related questions