Hashtable class implementation

humne class node ko T type ka kyu banaya hai?
class ka koi type thodi hota hai uske andar data members and functions ka type hota hai
and what do u mean by node*next… mext hamara pointer hai node type ka but why have we used t ?

Hey @jatinupadhyay786
Have you studied templates , if you haven’t my suggestion is please do that before doing this.
Now coming back to your question ,Yes class does not have a type and variable inside it does.
And here we are doing the same u see T value here we have a type for members and not the class

To define this class object we write Node<int> obj; or Node<char> obj; or whatever type we want

2nd thing Node<T>* next
Here next is a pointer to Node<T> since T can take and datatype so we have to mention to whcih type of Node it points to .

This is how we create generic classes which can take any type.

If you have ever used pair<int,int> then here also its implemented using templates and you can create any pair for example pair<char,double>

I hope ur query is resolved .

Hey @jatinupadhyay786
I hope your doubt is resolved ,if its then please mark it as resolved :slight_smile:
If its not then let me know the issue.