Question: I need help with an SML Coding Project I am working on for my Discrete Math II class. I ' m given an SML function
I need help with an SML Coding Project I am working on for my Discrete Math II class. Im given an SML function where I need to fill in the ifthenelse statements. Here is the function below:
fun bfsVisitg v found, bfsEdges, workList
let val adj getAdjacentg v;
fun stepufound bfsEdges workList
if
then
else ;
in foldlstepfound bfsEdges, workListadj
end;
This code also uses the following datatypes and the exception:
datatype vertex V of int int list;
datatype graph G of vertex list;
exception NoSuchVertex;
It also uses these helper functions:
fun getAdjacentG v raise NoSuchVertex
getAdjacentGVu adj::rest v
if u v then adj else getAdjacentGrest v;
fun contains x false
containsy::rest, x y x orelse containsrest x;
As you fill out the ifthenelse statements, please also provide a list of sample outputs I can use for the function so I can get a better understanding of what to do Thank you.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
