What is the computational complexity of training a Decision Tree?

Updated May 16, 2026

Short answer

Training a Decision Tree typically takes O(n log n * d) time depending on dataset size and feature count.

Deep explanation

At each node, the algorithm evaluates splits across all features and possible thresholds. Sorting features dominates cost, leading to O(n log n) per feature in naive implementations. Optimizations reduce this using presorted values or histograms. Depth of the tree adds additional multiplicative cost.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Decision Trees interview questions

View all →