Question: Consider the function What AmI, whose pseudocode is given below. The algorithm takes a graph as an input and outputs either true or false. The
Consider the function What AmI, whose pseudocode is given below. The algorithm takes a
graph as an input and outputs either true or false. The algorithm also uses a global array that
holds a Boalean value for every vinV and a global integer variable
input : graph
output: either true or false
function What AmI
for vinV do false;
clarr;
for vinV do
if false then
clarrc;
subWhatAmI ;
if then
return true
return false
procedure subWhatAmI
true;
for do
if false then subWhatAmI
Given a graph then the function What AmI returns true if and anly if:
is disconnected
has at most components
has more than components
all components of have more than two vertices
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
