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 8646871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:55:28+00:00 2026-06-12T12:55:28+00:00

I am reading through this article , where it is mentioned that we can

  • 0

I am reading through this article, where it is mentioned that we can get rid of one side of the tree by performing rotations in a specific manner, and then traversing the tree down in one direction and deleting the elements.

Although I understand what they are trying to do, I do not understand why?

What advantages might this type of deletion provide as opposed to a simple postorder deletion?

One advantage I can think of is saving on the memory used by recursion, but I think that is an insignificant overhead as compared to traversing the tree twice, once for rotating, and then for deleting. Am I missing something here?

  • 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-12T12:55:29+00:00Added an answer on June 12, 2026 at 12:55 pm

    The article seems to be staying that the point of this method is to avoid recursion (and its consumption of stack space): “Hmm…what if we rearranged nodes so that they didn’t have any left subtrees? Then we could just descend to the right, without need to keep track of anything on a stack.”

    In general, I prefer to avoid recursion when I cannot be sure that its depth will be reasonable, because you will run out of stack space long before you run out of any other sort of memory – in some cases because the system is designed to limit recursion to catch errors causing infinite recursion. However, I think this is less important here, where you have already admitted that other routines in the same package need recursion. Also, the depth of recursion depends on the depth of the tree, and for a balanced tree this will be roughly the logarithm of the number of nodes it it, and so should never be too deep.

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

Sidebar

Related Questions

Can Any one help me reading this XML and Looping through <MedicationDispensed> I get
Reading through this MSDN article http://msdn.microsoft.com/en-us/library/dd460648.aspx I'm seeing a claim that MEF doesn't have
Reading through this excellent article about safe construction techniques by Brain Goetz, I got
I saw this article pop-up in my MSDN RSS feed, and after reading through
I've been wondering about this for a while after reading through an interesting article
I'm reading this article about creating a global hotkey. I've gone through the tutorial
i am reading articles like this one and this one to walk through the
I was reading through this article: http://aws.typepad.com/aws/2008/12/running-everything-on-aws-soocialcom.html And I was wondering if this was
I'm currently reading through this jquery masking plugin to try and understand how it
I have been reading through this wonderful website regarding the recommended Python IDEs and

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.