• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Doubly Linked List in Python

Question 1

1. What is a doubly linked list?
 

  • A linked list with only one pointer to the next node

     

  • A linked list with two pointers, one to the previous node and one to the next node
     

  • A linked list where nodes are connected in a circular way
     

  • A linked list where nodes are connected randomly
     

Question 2

Which of the following operations can be performed efficiently on a doubly linked list?
 

  • Insertion at the beginning
     

  • Insertion at the end
     

  • Deletion at the beginning
     

  • All of the above
     

Question 3

Which method is used to add a new node at the beginning of a doubly linked list in Python?

 

  • append()
     

  • insert()
     

  • add_first()
     

  • push()
     

Question 4

Which method is used to add a new node at the end of a doubly linked list in Python?
 

  • add_last()
     

  • insert()

     

  • append()
     

  • push()
     

Question 5

Which method is used to delete the last node of a doubly linked list in Python?

 

  • delete()
     

  • delete_last()
     

  • pop()
     

  • remove_last()
     

Question 6

Which method is used to delete the first node of a doubly linked list in Python?
 

  • delete_first()
     

  • delete()
     

  • pop()
     

  • remove_first()
     

Question 7

What is the time complexity of searching for an element in a doubly linked list?

 

  • O(1)
     

  • O(n)
     

  • O(log n)
     

  • O(n^2)
     

Question 8

Which method is used to get the length of a doubly linked list in Python?
 

  • count()

     

  • size()
     

  • length()
     

  • len()
     

Question 9

Which method is used to reverse a doubly linked list in Python?

 

  • reverse()
     

  • flip()
     

  • swap()
     

  • rotate()
     

Question 10

Which method is used to insert a new node at a specific position in a doubly linked list in Python?
 

  • insert()
     

  • add()
     

  • push()
     

  • append()
     

There are 10 questions to complete.

Last Updated :
Take a part in the ongoing discussion