java - Is jdk provided doubly linked list circular? -


is java doubly linked list circular ?

it written in java docs. looks likes circular when see linked list source code here relevant code snippet if

private entry<e> more ...entry(int index) { ...         entry<e> e = header;         if (index < (size >> 1)) {            ...         } else {              (int = size; > index; i--)                 e = e.previous;         }         return e;     } 

update :- circular mean

  1. header previous node should last node seems true here
  2. and last node next node should header node

going criteria

  1. header previous node should last node seems true here
  2. and last node next node should header node

linked list circular because if see add method implementation internally calls addbefore, entry going insert points header next link , header points last entry inserted previous link


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -