Search⌘ K
AI Features

Binary Tree Preorder Traversal

Explore how to implement binary tree preorder traversal using depth-first search. Understand visiting nodes in the order of current, left subtree, and right subtree to return the correct node values for coding interviews.

Statement

Given the root of a binary tree, your task is to return a list containing the values of its nodes ...