Runtime error in sml function
- by Rpant
I am writing this function in sml
fun removeNodeswithNoIncoming((x:int,y)::xs,element:int) =
if x=element then
removeNodeswithNoIncoming (xs , element)
else
(x,y) :: removeNodeswithNoIncoming (xs , element)
| removeNodeswithNoIncoming(nil,element) = nil;
the function takes list of tuples [(0,0),(0,1)(1,2)] and another element 0
if first element…