Singly Linked List and Doubly Linked List difference

Difference

  1. SLL contains two field - data field and next link field. DLL contains three field - data field, previous link field, next link field.
  2. The traversal of SLL is done only in one direction i.e. through next node link. But the traversal of DLL is done in both directions i.e. either through previous node link or the next node link.
  3. SLL contains more memory than DLL because it less field than DLL.
  4. The complexity of insertion and deletion of a SLL is O(n). The complexity of insertion and deletion of a DLL is O(1)

Reference

Comments

Popular posts from this blog

Collections in Java

Exception Handling

OOPS Concept in Java