views:

56

answers:

2

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?

+2  A: 

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.

Mitch Wheat
Jason
A: 

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.

Woot4Moo