Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class DenseDoublyLinkedList
Note: This documentation is automatically generated.
Specialized doubly-linked list that initially holds [0..n-1] in an arbitrary
(user-specified) and fixed order.
It then supports O(1) removal and access to the next and previous element of
a given (non-removed) element.
It is very fast and compact: it uses exactly 8*n bytes of memory.
Method |
DenseDoublyLinkedList | Return type: explicit Arguments: const T& sorted_elements |
Next | Return type: int Arguments: int i Next() (resp. Prev()) must be called on elements that haven't yet been
removed. They will return -1 if called on the last (resp. first) element.
|
Prev | Return type: int Arguments: int i |
Remove | Return type: void Arguments: int i You must not call Remove() twice with the same element.
|
Size | Return type: int |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The `DenseDoublyLinkedList` class creates a specialized doubly-linked list containing elements \\[0..n-1\\] in a fixed order. It provides O(1) removal via `Remove(int i)` and access to adjacent elements using `Next(int i)` and `Prev(int i)`. `Next()` and `Prev()` returns -1 when called on the last/first elements, and they require that the element is not removed. The constructor `DenseDoublyLinkedList(const T& sorted_elements)` creates the list, and `Size()` gets its size. The list uses 8\\*n bytes of memory.\n"],null,[]]