Class cwi.adt.DoubleLinkedList
Defined in: cwi.adt.js.
Constructor Summary
Method Summary
insertBegin(data)
Insert an object in the beginning of the list and change the iterator to this new element.
insertEnd(data)
Insert an object in the end of the list and change the iterator to this new element.
insert(data)
Insert an object right after the element pointed by the iterator and change the iterator to this new element.
Constructor Detail
Method Detail
insertBegin(data)
Insert an object in the beginning of the list and change the iterator to this new element.
Parameters:
{Object} | data | Element to be inserted |
insertEnd(data)
Insert an object in the end of the list and change the iterator to this new element.
Parameters:
{Object} | data | Element to be inserted |
insert(data)
Insert an object right after the element pointed by the iterator and change
the iterator to this new element. If the iterator is undefined, insert the
object in the end of the list.
Parameters:
{Object} | data | Element to be inserted |
remove()
: Object
Remove and return the element before pointed by the iterator. Then, the iterator
is moved to the next element of the list.
Returns:
{Object} |
hasNext()
: boolean
Return true if the iterator points to an element, otherwise, false.
Returns:
{boolean} |
merge(l)
Add a given list after the current list.
Parameters:
{cwi.adt.DoubleLinkedList} | l | the list that will be added after the current list |