Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:01:01+00:00 2026-06-12T02:01:01+00:00

I understand the idea behind the tree traversal as well as implementations, but here

  • 0

I understand the idea behind the tree traversal as well as implementations, but here is the question.
Why do we need them all?

Right now I only know that preorder traversal is used when parsing math expressions.
From the Wikipedia I also read than:

  • Inorder traversal is particularly common to use an inorder traversal on a binary search tree because this will return values from the underlying set in order, according to the comparator that set up the binary search tree (hence the name).
    Preorder traversal
  • Traversing a tree in preorder while inserting the values into a new tree is common way of making a complete copy of a binary search tree.
    One can also use preorder traversals to get a prefix expression (Polish notation) from expression trees: traverse the expression tree preorderly. (which I already stated)

But these examples are rather vague. Can anyone describe this in more depth. Especially with examples.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:01:02+00:00Added an answer on June 12, 2026 at 2:01 am

    Consider the problem of doing some file operation on a directory tree. When the operation is removal of files, then you need to empty each directory before removing the directory itself, so you need a post-order traversal. By contrast, when copying the hierarchy, you need to copy the directories first, so then you need a pre-order traversal.

    I honestly don’t see what’s vague about the BST in-order traversal. When you want to display the contents of a BST on-screen in a user interface, you want the keys to show up sorted, don’t you? (If you didn’t, then using a BST would probably be a bad idea since a hash table is often faster.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A beginner question here. My goal: to understand the design rationale behind this. When
I understand the general idea behind the this keyword but I'm having trouble figuring
I didn't understand well the idea behind of proxies in ExtJS. Can I use
I am trying to understand the idea behind ArrayAccess Interface, I dont understand what
I understand (I think) the basic idea behind RESTful-ness. Use HTTP methods semantically -
Please not that I fully understand this is a dumb ass idea, but its
I understand this is an easy question but for some reason this just isn't
I understand the idea behind test-driven development, write tests first, code against tests until
I am new to complex data structures. I kind of understand the idea behind
I understand the reasoning behind the rails 3.1 asset pipeline: we compile all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.