Summer Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
14
:
03
:
47
:
29
Back to Dashboard
Tree Diagonal Traversal
Medium
Given a binary tree, print its diagonal traversal. In a diagonal traversal, all nodes that share the same number of right-edge traversals from the root are grouped together on the same diagonal.
More specifically, the diagonal index of a node equals the number of right edges on the path from root to that node. Within each diagonal, nodes are printed in the order they appear during a breadth-first traversal of the tree. ...
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.