0
$\begingroup$

I want to know if there exists any mathematical operator which can represent the idea of accessing explicitly a member of some object.

In this case it would be for describing that a node $n_l$ is left child of a node $n$. At the moment I know there exists the operator $::$ which states that its right side operand is member of its left side one. But I want to know if there is some alternative way because in C++ the operator $::$ is used for indicate global scope or static variable accessing.

Here one example: $\text{BalanceFactor}(n)=h(n::n_r)-h(n::n_l)$

Note: I thought in the $\rightarrow$ operator but it is also used in function definitions, I do not want to confuse my students.

$\endgroup$

1 Answer 1

0
$\begingroup$

The C (and C++, and Pascal, and...) way is to say struct.member.

Or use a function: $h(T)$ is the height of the tree $T$. Or use special variables with subindices: $h$ is the height of the tree, $h_l$ is the height of it's left subtree, ...

Just (a) try to be (more or less) consistent in notation, (b) define your usage clearly, and (c) use the notation of the textbook/the notation of popular books/sites like Wikipedia, Wolfram's MathWorld, perhaps others. Students will go looking there, translating to and fro just breeds frustration.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .