Doubly Linked List deleting a node - Example - Data Structure

Q.  What time is required for deleting a node ' x ' from a Doubly Linked List whose having ' n ' nodes?
- Published on 26 Aug 15

a. O (n)
b. O (log n)
c. O (1)
d. O (n log n)

ANSWER: O (1)
 

    Discussion

  • Nirja Shah   -Posted on 21 Nov 15
    Time required for deleting a node ' x ' from a Doubly Linked List whose having ' n ' nodes is O ( 1 ).
    There are three parts in doubly linked list. The first part contains the address of the preceding elements in the list. The second part contains the information of the element and the third part contains the address of the succeeding elements in the list.
    Deleting a node in doubly linked list is more efficient than in singly linked list.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)