Hot answers tagged

27 votes
Accepted

How to respond to the two-handed approach to swapping

Don't overcomplicate things. Your first instinct, that the computer only has one hand, was the correct one. This is a regular problem that new teachers have, and it sometimes takes a few years of ...
  • 31.8k
22 votes

How to respond to the two-handed approach to swapping

Re-evaluate what you think is "right", because you aren't but isn't right in computer science This is simply incorrect. Your student can create two variables called ...
  • 1,072
16 votes

How to respond to the two-handed approach to swapping

Your problem is that you tried to let your student "program" without establishing a language. Thus they were free to write their own "language" in which you can do two things at ...
5 votes

How to respond to the two-handed approach to swapping

This question reminds me of when a student failed to understand why a third variable was needed to exchange the value of two variables (i.e. to swap A and B, C=A, A=B, B=C). I managed to illustrate ...
  • 151
4 votes

How to respond to the two-handed approach to swapping

They took both their hands, picked up the second and fourth pencils (each in one hand), and swapped them! That works in reality... but isn't right in computer science. It depends on your paradigm. ...
3 votes

How to respond to the two-handed approach to swapping

Analogies & metaphors are imperfect, so let's share the expectation that they are just illustrative. Rules of what is possible (and not) are very important, and we can compare the rules of pencils ...
  • 323
3 votes

How to respond to the two-handed approach to swapping

I do the swap example pretending to have two largish (2-hands-to-lift) boxes side-by-side on a desk (with only enough room for two boxes). After we lift the first we have to look for a place to put it,...
3 votes

How to respond to the two-handed approach to swapping

In thinking about this, and especially the answer of Graham, I think that what we really do in the standard three step process is a two handed swap without thinking of it. So, it is a failure of the ...
  • 35.3k
2 votes

How to respond to the two-handed approach to swapping

Graham pointed out that the assumtions of the question are wrong. And Peter Cordes elaborated a bit in the comments. Considering a target VLIW (Very Long Instruction Word) architecture can help ...
  • 834
2 votes

How to respond to the two-handed approach to swapping

Ben's answer is great, but allow me to suggest that you don't need to "respond" to the two-handed approach at all: just say when you're explaining the problem in the first place that they ...
  • 519
1 vote

Real life examples of 0-indexing

Since this question was posted, I have come to realise that a ruler is not a metaphor for this think. It is the think. Zero indexing is simply measuring the distance from the start. There are many ...

Only top scored, non community-wiki answers of a minimum length are eligible