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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:29:25+00:00 2026-05-23T05:29:25+00:00

I came across the following code and despite some help from others, I am

  • 0

I came across the following code and despite some help from others, I am still having trouble understanding it.
This code is supposed to implement a General Tree. Single_List and Single_Node classes are also available for use in implementation.

        template <class Object>
        class General_tree {
            private:
                Object element;  // the stored in the node
                Single_list< General_tree<Object> * > children;
                    // a linked list of pointers to general trees
            public:
                Object retrieve() {
                    return element;
                }
                // ...
        };

Can someone tell me what one instance of this class will consist of?

I think it will consist of

                           [element value in node made by Single_Node] -----> 
                             /                           next pointer (part of Single_list class)
                            / 
                           / children pointer to another such instance of General_Tree
                          V

Then these instances can be combined to form a tree… I am still getting used to Object Oriented Design I guess so please let me know if this reasoning and interpretation is correct?

thanks!

  • 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-23T05:29:26+00:00Added an answer on May 23, 2026 at 5:29 am

    The tree object is really a node in the tree, where children points to the nodes at the next level, which will have pointers to their children, etc.

    Together they form a subtree (or the whole tree, if it is the root node).

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

Sidebar

Related Questions

Looking through some code I came across the following code trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); and I'd like
Today at work we came across the following code (some of you might recognize
I am debugging some 3rd party code in IntelliJ 11 and came across following
I came across the following code snippets from Apple's Documentation. The Interface is fairly
I am reading this blog and came across following code RunAgain = Class.new(Exception) def
I've been looking at this question and came across the following code in one
I came across this following code: #include<stdio.h> #define d(x) x(#x[3]) int main(){ d(putchar); }
I came across the following code that compiles fine (using Visual Studio 2005): SomeObject
I came across the following code in a code base I am working on:
I have came across the following code, and being a C beginner, I came

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.