Constant-Time Head Operations
Insertion or deletion at the head of a linked list is O(1) because it requires changing only a constant number of references. There is no need to shift or traverse the remaining elements.
Head insertion requires updating the new node's next reference and head.
Head deletion only requires moving head to the next node.
The operation does not depend on the number of nodes.
Therefore, both operations are O(1).