We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
count_nodes
1 parent fa000c7 commit c0d051cCopy full SHA for c0d051c
src/EquationUtils.jl
@@ -2,8 +2,15 @@ module EquationUtilsModule
2
3
import ..EquationModule: Node, copy_node
4
5
-# Count the operators, constants, variables in an equation
6
-function count_nodes(tree::Node)::Int
+"""
+ count_nodes(tree::Node{T})::Int where {T}
7
+
8
+Count the number of nodes in the tree.
9
10
+# Arguments
11
+- `tree::Node{T}`: The tree to count the nodes of.
12
13
+function count_nodes(tree::Node{T})::Int where {T}
14
if tree.degree == 0
15
return 1
16
elseif tree.degree == 1
0 commit comments