← Microsoft questions

Preorder traversal without recursion

Filed under Microsoft · Also reported at Salesforce, WatchGuard

Given the root of a binary tree, return a list containing its node values in preorder traversal (root, left, right) iteratively without using recursion.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.