I was watching the algoritmhs course by mycodeschool and he said that when we add a new item on a given position the worst case would be $O(n)$. Everywhere I look says insertion is $O(1)$... Now I understand that insertion itself might be $O(1)$, but if I have the following interface (this is something I made up, not a real thing I'm working):
insertAtIndex(any item, int index)
Would this be $O(n)$? Since I will search $O(n)$ and then insert $O(1)$?