Nodes

This is a discussion on Nodes within the C++ Programming forums, part of the General Programming Boards category; Hi
can a single node have have multiple data types and information in it stored?
im doing a binary tree ...

No. What I am suggesting is that you write a binary tree class that works with data that are objects of int type. You implement and test it. Later, you replace these objects of int type with objects of type T, where T is a class that contains name, key, description, etc. You don't have to do it this way, but it will make things easier for you.

No. What I am suggesting is that you write a binary tree class that works with data that are objects of int type. You implement and test it. Later, you replace these objects of int type with objects of type T, where T is a class that contains name, key, description, etc. You don't have to do it this way, but it will make things easier for you.

i thankyou for your reply i really do appricate it , but to be honest im a bit short on time so i cant reconstruct my program to much.... is there anyway this can be done through the way i have it at the momment? to combine all my different strings into one node?

i thankyou for your reply i really do appricate it , but to be honest im a bit short on time so i cant reconstruct my program to much.... is there anyway this can be done through the way i have it at the momment? to combine all my different strings into one node?

thanks

Originally Posted by Marcello

Bump , how do i put 5 different strings of information into a single node ?

It's exactly like Laserlight said. A node would contain one piece of data. If you want your node to contain several pieces of data, then combine those pieces of data into a class or struct and use that struct or class as the node data.
This is the easiest way of doing it.