While writing a solution, should i avoid creating new features in a class? Is it a good practice?
Can i add a horizontal distance feature in my tree class?
@tusharnitharwal hey instead of taking horizontal feature in class just pass horizontal distance as parameter of function in recursion call ,initialise it with 0 and for left call pass it hd-1 and for right pass it hd+1 where hd is starting horizontal distance.Hope you get it.Feel free to ask any doubt.
Is it a good practice to add new features to an existing class like this?
@tusharnitharwal it all depends on your requirement ,agar class ke har object ke lie woh faeture hai to tumhe lena chyy otherwise no need,it all depend on requirement neither its bad practice nor good.