QUESTION IMAGE
Question
question # 5
multiple choice
which method adds an element at the beginning of a deque?
addleft
popleft
appendleft
insertleft
Brief Explanations
In Python's collections.deque (double - ended queue), the appendleft method is used to add an element to the beginning (left - hand side) of the deque. addleft is not a valid method for deque. popleft is used to remove and return the left - most element. insertleft is not a standard method for deque.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
C. appendleft