What is the worst-case space complexity of an unpruned binary decision tree trained on N samples?

Quick Overview

Work out the worst-case memory of a fully grown binary decision tree trained on N samples. Tests whether you can bound the number of leaves and total nodes, account for what each node stores, and separate tree size from tree depth and training memory.

What is the worst-case space complexity of an unpruned binary decision tree trained on N samples?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is the worst-case space complexity of an unpruned binary decision tree trained on N samples? The tree is grown with no depth, leaf-size or leaf-count limits until no further split is possible. ```hint Count leaves first Bound the number of leaves, then relate the number of internal nodes to the number of leaves in a tree where every split has exactly two children. ``` ### What a Strong Answer Covers - A bound on the number of leaves and the reason it holds. - The relation between leaves and total nodes when every split has two children. - What each node stores, and when per-node storage changes the bound. - How worst-case depth differs from worst-case size, and what depth means for prediction and training. ### Follow-up Questions - What do `min_samples_leaf`, `max_leaf_nodes` and `max_depth` each do to the node bound? - What is the worst-case time to train an unpruned tree on N samples with d features? - How does the memory picture change for a random forest of T unpruned trees?

Overview: Work out the worst-case memory of a fully grown binary decision tree trained on N samples. Tests whether you can bound the number of leaves and total nodes, account for what each node stores, and separate tree size from tree depth and training memory.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What is the worst-case space complexity of an unpruned binary decision tree trained on N samples?

The tree is grown with no depth, leaf-size or leaf-count limits until no further split is possible.

What a Strong Answer Covers Guidance

  • A bound on the number of leaves and the reason it holds.
  • The relation between leaves and total nodes when every split has two children.
  • What each node stores, and when per-node storage changes the bound.
  • How worst-case depth differs from worst-case size, and what depth means for prediction and training.

Follow-up Questions Guidance

  • What do min_samples_leaf , max_leaf_nodes and max_depth each do to the node bound?
  • What is the worst-case time to train an unpruned tree on N samples with d features?
  • How does the memory picture change for a random forest of T unpruned trees?