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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:53:28+00:00 2026-05-30T22:53:28+00:00

I am working on a Binary search tree. So,here is the structure used for

  • 0

I am working on a Binary search tree.

So,here is the structure used for representing the node:

typedef struct TreeNode
{
int num;
struct TreeNode *left,*right;
}TREENODE;

To insert a node in the tree I have the following method signatire

void InsertNode(TREENODE **root,int data);

In the above method why do we require double pointer.We can use a single pointer!

Are we using double pointer to avoid duplication?

  • 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-05-30T22:53:29+00:00Added an answer on May 30, 2026 at 10:53 pm

    No, this is needed in case of rebalancing. After rebalancing root could be changed.

    Ok, I will expand. Double pointer allows you to modify the pointer. So what is tree root in your case? Pointer to TREENODE. Some operations like search will never modify it. But some operations might need to change it, so that another node becomes new root. So they have to have access to that variable that you use as root. One example why they might need it is rebalancing, see AVL trees.

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

Sidebar

Related Questions

I have been working on a simple binary search tree for a larger project.
So recently I have been working on phonebook project that uses Binary Search Tree.
I'm working on a project where I have to make a binary search tree
I am working with a binary file structure. The code example for reading the
Here is a function to find the lowest common ancestor of a binary search
I have rewritten the Binary Search Tree code found in the following links to
Alright, so I've been trying to implement a simple binary search tree that uses
I'm working on a simple app and the specs mandate that a binary search
I'm working on creating a binary search algorithm in C that searches for a
I'm working on implementing an AVL Search tree. So far I've finished the coding

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.