Singly, Doubly & Circular Linked List

This is a basic type of Linked List.

Singly Doubly Circular
Concept One way direction Two way direction One way direction in a circle
Has head Yes Yes No-because tail will refer to first node
Has tail Yes Yes Yes
No of Node 1-next node 2-next node & previous node 1-next node
insert() O(n) O(1) O(n)
delete() O(n) O(1) O(1)
Benefit require small space for each element allow to traverse the list in both directions execute to the end can be quickly


Reference :

3 comments:

  1. Assalamualaikum,

    nk minta tolong post syntax utk linked list.. yg tu lemah skit laa.. utk class, constructor, isEmpty, is Full, insertAtFront, RemoveFromFront & RemoveFromBack, getFirst, getLast... kalau x menyusahkan.. suka blog ni, mcm ter-update apa yg belajar ari ni ja :)))

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. insyallah, saya akan cuba post nya pada hari esok...

      Delete