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
- header previous node should last node seems true here
- and last node next node should header node
going criteria
- header previous node should last node seems true here
- 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
Post a Comment