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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:06:46+00:00 2026-06-03T21:06:46+00:00

I create my tree using a read function, which uses a while loop to

  • 0

I create my tree using a read function, which uses a while loop to retrieve lines from a text file, in that loop I create a node, and then use an insert method to insert the node into the correct place in tree.

For my copy constructor I do something similar, I pass in the root to a helper function a little like my insert function, then copy over the name of the node passed in to a node in the function. looks a little like this:

newNode->name  = pNode->name;           
newNode->left  = copyConstructorHelper(pNode->left);            
newNode->right = copyConstructorHelper(pNode->right); 

I then return a new node.

After running the sampling built into visual studio, the read method uses up %36 percent of the memory whilst the copy constructor only uses up %4. This is a massive difference, could someone explain why please?

  • 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-03T21:06:47+00:00Added an answer on June 3, 2026 at 9:06 pm

    Part is likely the file IO; make a version of your first method that gets its data from a string (or array of same) and see what difference that makes.

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

Sidebar

Related Questions

I've been using seesaw.tree/simple-tree-model to create my TreeModels, the docs say that this is
I'd like to create a tree structure from JSON, but with multiple columns that
I want to create tree structure using web service. I have used bottom up
I'm currently using SMO and C# to traverse databases to create a tree of
I am looking to create an expression tree by parsing xml using C#. The
I need to create a menu tree using HTML. I had a search on
I am trying to create an HQL query that will filter a tree based
I'm using jQuery Tools ( http://flowplayer.org/tools/index.html ) to create tooltips, I've created a js-file
I am attempting to create a behavior tree using C#. For anyone who doesn't
I am trying to create a complete binary tree using a linked list, instead

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.