Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Linked list
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Random-access lists=== A [[random access list|random-access list]] is a list with support for fast random access to read or modify any element in the list.<ref name="okasaki">{{cite book |last=Okasaki |first=Chris |date=1995 |title=Purely Functional Random-Access Lists |work=In Functional Programming Languages and Computer Architecture |publisher=ACM Press |pages=86β95 |url=http://cs.oberlin.edu/~jwalker/refs/fpca95.ps |format=PS |access-date=May 7, 2015}}</ref> One possible implementation is a [[skew binary random access list|skew binary random-access list]] using the [[skew binary number system]], which involves a list of trees with special properties; this allows worst-case constant time head/cons operations, and worst-case logarithmic time random access to an element by index.<ref name="okasaki"/> Random-access lists can be implemented as [[persistent data structure]]s.<ref name="okasaki"/> Random-access lists can be viewed as immutable linked lists in that they likewise support the same O(1) head and tail operations.<ref name="okasaki"/> A simple extension to random-access lists is the [[min-list]], which provides an additional operation that yields the minimum element in the entire list in constant time (without{{clarify|r=should be "disregarding"?|date=October 2011}} mutation complexities).<ref name="okasaki"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)