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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:26:20+00:00 2026-06-17T07:26:20+00:00

I am reading a book about Binary Search Tree and something weird came up.

  • 0

I am reading a book about Binary Search Tree and something weird came up. I came across the following declaration in a function parameter.

BinaryNode * & t

What does it mean? Pointer of the address of t?


For context, this is the code where I saw this. The private insert function is a helper function for public insert function, and private insert function looks for the right place to insert using recursion.

class BST
{
public:
   void insert(const Comparable & item)

private:
   BinaryNode *root;
   struct BinaryNode
   {
       Comparable element;
       BinaryNode *left;
       BinaryNode *right;
       BinaryNode(const Comparable & theElement, BinaryNode *lt, BinaryNode *rt) : 
          element(theElement), left(lt), right(rt) {}
   }
   void insert(const Comparable & item, BinaryNode * & t) const;
};
  • 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-17T07:26:22+00:00Added an answer on June 17, 2026 at 7:26 am

    In your expression BinaryNode * & t)

                BinaryNode*                & t
               -------------              -----
                BinaryNode pointer        t is reference variable  
    

    so t is reference to pointer of BinaryNode class.

    Pointer of the address of t?

    You are confused ampersand & operator in c++. that give address of an variable. but syntax is different.

    ampersand & in front of some of variable like below:

    BinaryNode b;
    BinaryNode* ptr = &b;
    

    But following way is for reference variable (its simple not pointer):

    BinaryNode b;
    BinaryNode & t  = b; 
    

    and your is like below:

    BinaryNode b;
    BinaryNode* ptr = &b;
    BinaryNode* &t  = ptr;  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While reading a book about JavaScript I stumbled across an example: var names =
I am reading about closures in Javascript: The Good Parts book. There is following
I'm reading a book about programming ASP.NET in C#. The book makes the following
I am currently reading a book about bit fiddling and the following formula appears:
I'm reading book about OO programming in JavaScript and get some strange behaviour: function
While reading about binary semaphore and mutex I found the following difference: Both can
I'm reading a book about Ruby/Rails and have a question about something simple. In
Recently, I was reading book about Erlang which has hot deployment feature. The deployment
I'm reading a book about SQL. In that book, I saw strange query below:
I'm reading a book about SQL. In that book there's the term Ad Hoc

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.