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

  • Home
  • SEARCH
  • 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 70283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:42:23+00:00 2026-05-10T19:42:23+00:00

template <class T> void BT<T>::inOrder(void (*inOrderPtr)(T&)) { inOrderPtr(inOrder(this->root)); } template <class T> void BT<T>::inOrder(Node<T>*

  • 0
template <class T> void BT<T>::inOrder(void (*inOrderPtr)(T&))  {      inOrderPtr(inOrder(this->root));  } template <class T> void BT<T>::inOrder(Node<T>* root) const  {     if (root->left != NULL)        inOrder(root->left);        //something here     if (root->right != NULL)        inOrder(root->right);  } 

Ok I am trying to create this Traversal via recursion. I actually posted this problem before but I was going about it wrong due to me having to use a function pointer. I don’t understand what I’m suppose to do. I’ve got the public wrapper that calls on the private one… but the public one is the one with the function being passed in so what do I even do with it?? I feel retarded so even if someone were to give me a small hint I’m sure I’d get it. I just don’t know where to go from here.

an example of a code that calls on it is this:

first.inOrder(print_val) 
  • 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. 2026-05-10T19:42:24+00:00Added an answer on May 10, 2026 at 7:42 pm

    This is how to do it properly, but Node::GetItem needs implementing in order for this to be 100% correct:

    template <class T> T& Node<T>::GetItem() const  {     // TODO - implement getting a T& from a Node<T>     return m_item; // possible implementation depending on Node's definition  }  template <class T> void BT<T>::inOrder(void (*inOrderPtr)(T&))  {     inOrder(this->root, inOrderPtr);  }  template <class T> void BT<T>::inOrder(Node<T>* root, void (*inOrderPtr)(T&)) const  {     if (root->left != NULL)        inOrder(root->left, inOrderPtr);      inOrderPtr(root->GetItem());      if (root->right != NULL)        inOrder(root->right, inOrderPtr);  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 72k
  • Answers 72k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer If Option Compare Text is set at the module level,… May 11, 2026 at 1:31 pm
  • added an answer As john Rasch mentioned above, any file above the php.ini… May 11, 2026 at 1:31 pm
  • added an answer findstr can do recursive searches (/S) and supports some variant… May 11, 2026 at 1:31 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.