I thought this kind of thing was beyond the capacities of a crocodile. What with the reptilian brain and all. They are territorial, solitary, etc...
However, a brief wikipedia search reveals that the crocodile is "...among the more biologically complex reptiles despite their prehistoric look. Unlike other reptiles, a crocodile has a cerebral cortex..."
Fascinating. The beast can associate and reason.