The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
28 views asked ago in Programming by Active (1k points) | 28 views

1 Answer

0 votes

I think option C is the answer. Since the program uses 'mark' field to identify the counted nodes we have to set mark=1 somewhere in the program. So that leaves us with option A and C.
Lets look at option A, if we put a->mark=1 as the first statement then the If condition gets satisfied and the program ends there.

Therefore the line should be after the if statement

If(a->mark) return 0;

a->mark=1;

 

answered ago by (11 points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,997 questions
37,681 answers
96,743 comments
35,329 users