Why node has a templated class

node class can only be node type and pointer is node*
why template is used only for value template should use?

@kingshuk441 hey hmne template islie lia hai kyunki hm template ki jgah fir koi bhi type le skenge ,bar bar har datatype ke lie code nhi likhna pdega.

but why for node plz give explanation with a example i am unable to understand

@kingshuk441 hey ,a node of map contains key value and next pointer ,key will be of string type and value will be of any data type so bhaiya use template there ,and next pointer will be of node * type ,so now to make object we will use node * as t represent that node can be of any datatype value,that’s why we take that.Hope you get it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.