Snowflake logoSnowflake
Coding·45 minMembers

Pre-order Traversal Skipping Marked Nodes

Members only

A tree is given as an edge list. Some nodes are marked invalid. Return the pre-order traversal of the tree that skips the invalid nodes (their children promote to attach at the nearest valid ancestor)...

SWE
tree
dfs
tree-traversal
recursion
easy
Frequency
Single report
Last asked
2025-12-09
Stage
phone-screen

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...