Skip to content

Commit c0d051c

Browse files
committed
Document count_nodes
1 parent fa000c7 commit c0d051c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/EquationUtils.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ module EquationUtilsModule
22

33
import ..EquationModule: Node, copy_node
44

5-
# Count the operators, constants, variables in an equation
6-
function count_nodes(tree::Node)::Int
5+
"""
6+
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}
714
if tree.degree == 0
815
return 1
916
elseif tree.degree == 1

0 commit comments

Comments
 (0)