Yes, you are expected to write mathematical functions like the ones on
slide 53 (module 2). Whether the nodes exist or not should be a condition
that is included in your function description.
Vivian
CS240 Tutor
Post by kun qianPost by Doug StinsonPost by Chris JonesHello again,
When we are writing the functions to find the children and parent are
we to assume they exist?
Thanks,
You should check that they exist as part of your function description.
Doug Stinson.
I think it to check whether the node exist depends on implementation.
So I don't think the question should require the solution to check for
existence.
so we are just need to write a mathematical function like heap we talk on
class, for example: the left child of A[i] is A[2i].
am I right?
thanks~