Constraints limit for creating a tree

While doing CP, sometimes I came across with questions where number of nodes or n limit is 10^5, (n<=10^5). For such questions, creating a class node and then linking them is feasible? In other words, what should be the max limit of n such that we can create actuall tree with nodes?

experiment yourself