i trying return index of selected element of my Vector collection
type Node
name::AbstractString
value::Int
left::Nullable{Node}
right::Nullable{Node}
Node(name::AbstractString, value::Int) = new(name, value, Nullable{Node}(), Nullable{Node}())
end
function minimal(nodes::Vector{Node})
minnode=Nullable{Node}()
minval = nodes[1].value
for f in nodes
if f.value< minval
minval= f.value
minnode = f
end
end
return find(nodes .== minnode)
end
Problem is of course find(nodes .== minnode)
, how can I return index of this element
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…