Complexity of algorithm inserting an element in a circular linked list at the front end

In a circular linked list, if an elements needs to be inserted at front [just before the node pointed by head], can be done in O(1) (see the answer here)

But in a book currently, I have, it is mentioned that it is done in O(n) (the usual method). I also saw few lecture ppts, they all mention the usual method of traversing the list & adding an element.

My question is :

1. In practical scenarios which method is used ?

2. I am about to attend an exam, which consists of MCQs, if above question is asked shall I mark O(n), since that is the standard answer ?

• Did you read the accepted answer in the link you gave? – Pål GD Mar 23 '13 at 10:14
• I am about to attend an exam, which consists of MCQs, if above question is asked shall I mark O(n), since that is the standard answer ? Ask the lecturer, or choose O(1) and send an email to him after exam. – nhahtdh Mar 23 '13 at 10:26
• @Pål GD - Yes, I did. Why ? – avi Mar 23 '13 at 10:37
• Since $O(1) \subseteq O(n)$, just check the largest $O$-class they give. (This ill-posed question illustrates why MCQs are meaningless. Beware if they refer to a particular implementation, though.) – Raphael Mar 23 '13 at 15:59
• @avi: That's a pity. Can you write to them? Mind, though, that you can phrase such a question properly, e.g. "Which is the tightest bound on the runtime of the given algorithm?". – Raphael Mar 24 '13 at 15:04