deque

Last Updated :
Discuss
Comments

Question 1

What is deque ?

  • A

    A deque with insert/delete defined for both front and rear ends of queue

  • B

    queue implemented with a circular linked list

  • C

    a queue implemented with singly linked list

  • D

    none of these

Question 2

Which of the following are types of restricted deques?

  • A

    Input Restricted Deque
    Output Restricted Deque

  • B

    circular Restricted Deque

  • C

    head Restricted Deque
    Output Restricted Deque

  • D

    Input Restricted Deque

Question 3

Output of given code is

Python
from collections import deque
queue = deque(['name','age','DOB'])
print(queue)
  • A

    ['name', 'age', 'DOB']

  • B

    deque(['name', 'age'])

  • C

    deque['name', 'age', 'DOB']

  • D

    deque(['name', 'age', 'DOB'])

Question 4

Deque in Python is implemented using the module __________

  • A

    collections

  • B

    collect

  • C

    dequeue

  • D

    collection

Question 5

Dequeue can be implemented using 

  • A

    circular linked list

  • B

    doubly-linked list 

  • C

    doubly-linked list

  • D

     a circular array

Question 6

Dequeue can be applied as

  • A

    Stack and queue 

  • B

    stack and linked list

  • C

    linked list 

  • D

    queue

Question 7

Which is the correct method signature for inserting element 'a' at position 'i' in deque?

  • A

    insert(position, element)

  • B

    insert(element, position)

  • C

    inserted(position, element)

  • D

    inserting(position, element)

Question 8

extendleft(iterable) is use for

  • A

    This function is used to add multiple values at the left end of the deque. The argument passed is iterable. Order is reversed as a result of left appends

  • B

    This function is used to add single value at the left end of the deque. The argument passed is iterable. Order is reversed as a result of left appends

  • C

    This function is used to add multiple values at the left end of the deque. The argument passed is iterable. 

  • D

    none of these

Question 9

Which of the following is true

  • A

    deque provides an O(1) time complexity for append and pop operations

  • B

    deque provides an O(N^2) time complexity for append and pop operations

  • C

    deque provides an O(NLogN) time complexity for append and pop operations

  • D

    deque provides an O(N) time complexity for append and pop operations

Question 10

append() function is used for

  • A

    This function is used to delete the value in its argument to the right end of the deque.

  • B

    This function is used to insert the value in its argument to the right end and delete left item of the deque.

  • C

    This function is used to insert the value in its argument to the left of the deque.

  • D

    This function is used to insert the value in its argument to the right end of the deque.

There are 10 questions to complete.

Take a part in the ongoing discussion