User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
what was the way to count the number of nodes in this kind of structure?
3
0
0
0
User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
like, I know, by checking different depths, that the count is always (2^depth+1)-1

but that feels wrong
​:blobwtfnotlikethis:​
3
0
0
0
User avatar
Persephone @mindpersephone@spookygirl.boo
5mo
@kitten only when balanced though. if un-balanced you're stuck with a recursive count iirc
:neocat_sign_thx:1
1
0
0
1
User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
@mindpersephone this is just for a unit test so that'll do for now
0
0
1
0