Reputation: 11363
With an assignment dealing with access control lists, it was required to construct a doubly-linked list first, as Java doesn't include that in the SUN API. I can understand if the professor wanted us to create the Doubly Linked List from scratch to understand how it works (like writing a sort program vs using the baked in methods), but why exclude it from the library?
That got me to thinking, what determines if a data structure is included in the basic language library? For example, in Java, why is there a LinkedList class but not a DoublyLinkedList?
Upvotes: 2
Views: 95
Reputation: 24336
I believe, of course this is opinion, that the only data structures that all programming languages have internally built into them are the following: Array, List, Tree, Graph, and Bag. I think List and Bag can pretty much be interchangeable in terms of vocabulary. Keyword being think.
Upvotes: 0
Reputation: 300719
According to the Java Docs:
All of the operations perform as could be expected for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.
Upvotes: 2