Homeworks will be graded mainly on effort, instead of correctness. Points may be deducted for things like being late, not stapling it (if it is more than one page), using torn paper, using paper with fringes, not attempting questions, and messiness. As a result, you are allowed to collaborate with other students. Work out a solution to the problem on your own first, then get together with other students to see how their answers compare. You can do this before or after you hand in the work. If you are not sure what the answer should be, ask in class, post to the discussion page, see the TA during his/her office hours, or see the professor during his office hours. You are still expected to turn in your own copy of the homework.
An explanation is expected for each answer. If you only provide diagrams, you should not expect to receive points. For code, good, descriptive comments will serve as an explanation.