clarification of ex 4

0 views
Skip to first unread message

Aaron

unread,
Jun 14, 2011, 12:26:10 PM6/14/11
to BYU CS 142 (Spring 2011) [McCarthy]
What does it mean when the problem states:

the node's value is modified in place.

I'm confused on what this means.

Jay McCarthy

unread,
Jun 14, 2011, 12:35:05 PM6/14/11
to byu-cs-jm-14...@googlegroups.com, BYU CS 142 (Spring 2011) [McCarthy]
It is mutated

iPhoneから送信

Joe Larson

unread,
Jun 15, 2011, 1:54:57 AM6/15/11
to BYU CS 142 (Spring 2011) [McCarthy]
How do you go about mutating a string then? I thought we were taught
that you can't mutate Strings.

Joe Larson

unread,
Jun 15, 2011, 2:09:13 AM6/15/11
to BYU CS 142 (Spring 2011) [McCarthy]
Never-mind, it works. For some reason I thought we were taught in
class that you can't have a string "n" already equal to something and
then reassign it. Something about it being "immutable" or something.
But I guess it can.

Jay McCarthy

unread,
Jun 15, 2011, 7:33:10 AM6/15/11
to byu-cs-jm-14...@googlegroups.com
We don't mutate the pieces of the string, we mutate the node to have a
new string in it.

Jay

2011年6月15日5:54 Joe Larson <brothe...@gmail.com>:

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Reply all
Reply to author
Forward
0 new messages