Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
4.80/5 (2 votes)
See more:
Hi Everyone :)

While going through some C++ articles. I came across the term "Node Class". I tried to google about same. But unfortunately didn't get complete information and also it was not clear.

If somebody has good understanding of Node class....How to implement it..where exactly it is useful etc etc. Please share your knowledge with EXAMPLE.

Thanks in advance :)

Happy Learning :)
Posted
Updated 25-May-12 22:40pm
v2

Please see here:
http://www.globalguideline.com/interview_questions/Answer.php?a=What_is_a_node_class_in_c[^]

Although it depends on the context....
Notice, there may be something else too...
For example the Node of tree, list, array,vector and etc.
Ex:
http://en.allexperts.com/q/C-1040/Doubly-Linked-List.htm
 
Share this answer
 
Comments
sourabhmehta 26-May-12 5:58am    
Thanks Alex,

yeah i already went through the link you provided. That explanation is not clear to me.
In object oriented programming (OOP) , you can build a tree of classes.
For example might be some class A, which is inherited from the class B ,class B which is inherited from the class C.

Please see following image:
http://www.codeproject.com/KB/cpp/386982/standard_composite.GIF

The hierarchy of classes including one parent class and several child nodes.

1) Worker is Node
2) Manager is Node

Please read about the inheritance in C++ or C# or Java
 
Share this answer
 
Comments
sourabhmehta 27-May-12 5:17am    
Thanks for your inputs :)
Volynsky Alex 3-Jun-12 16:28pm    
:) you are welcome
A node class is simply a class representing a node in a data structure. Data structures like lists, trees, maps, etc. consist of so-called nodes. And a representation of such a node in form of a C++ class is called a node class. As simple as that.

If you don't understand what is meant my the term "node", go ahead and read about data structures. That will probably clarify things for you.
 
Share this answer
 
Comments
stib_markc 26-May-12 8:16am    
5!
nv3 26-May-12 9:13am    
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900