Summer Sale is Live! Unlock 40% OFF on All Job-Oriented Training Programs – Limited Time Only! Offer Ending in
D
H
M
S
Get Now
Problem Submissions Solution

Preorder Traversal Of Binary Tree

Difficulty: Easy

Acceptance: %

Points: 20.00

Pre-order traversal first visits the node, then visits the left child (including its entire subtree), and finally visits the right child (including its entire subtree).

Given a Binary Tree, your task is to return its Pre-Order Traversal.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n)

Expected Auxiliary Space: O(log n) for recursive calls + O(n)

Constraints:
  • 1 <= number of nodes <= 10^5
  • 0 <= node->data <= 10^5
Companies:
Amazon Microsoft Walmart Flipkart
Topics:
Tree
Locked Content
Access Restricted: Please Login to access the code editor and test cases.