Skip to main content
forgot a word there.
Source Link
user40980
user40980

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in databases and file systems). The list can can go on and on and on (and that isn't a complete list).

Some of these things that I mentioned are fuzzy in their implementation. One can implement a Map with a hash table (backed by an array) - a HashMap, a red-black tree (a particular implementation of a balanced binary tree - just be glad its not an avl tree) as a SortedMap, or even linked lists as a ConcurrentSkipListMap. The key thing is how they behave - all of these implementations implement a set of the same methods guaranteeing they all have a get(K) and put(K, V) (along with some other things).

The linked list (concrete implementation) is a particular way of implementing a List (an abstract data type). You could also do it with a flexible array (another concrete implementation).

That one structure is used as the foundation for another structure does not make it less of a structure. The key point in the data structure is that there is data, and it is structured in some way so you know where to look for its components.

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in). The list can can go on and on and on (and that isn't a complete list).

Some of these things that I mentioned are fuzzy in their implementation. One can implement a Map with a hash table (backed by an array) - a HashMap, a red-black tree (a particular implementation of a balanced binary tree - just be glad its not an avl tree) as a SortedMap, or even linked lists as a ConcurrentSkipListMap. The key thing is how they behave - all of these implementations implement a set of the same methods guaranteeing they all have a get(K) and put(K, V) (along with some other things).

The linked list (concrete implementation) is a particular way of implementing a List (an abstract data type). You could also do it with a flexible array (another concrete implementation).

That one structure is used as the foundation for another structure does not make it less of a structure. The key point in the data structure is that there is data, and it is structured in some way so you know where to look for its components.

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in databases and file systems). The list can can go on and on and on (and that isn't a complete list).

Some of these things that I mentioned are fuzzy in their implementation. One can implement a Map with a hash table (backed by an array) - a HashMap, a red-black tree (a particular implementation of a balanced binary tree - just be glad its not an avl tree) as a SortedMap, or even linked lists as a ConcurrentSkipListMap. The key thing is how they behave - all of these implementations implement a set of the same methods guaranteeing they all have a get(K) and put(K, V) (along with some other things).

The linked list (concrete implementation) is a particular way of implementing a List (an abstract data type). You could also do it with a flexible array (another concrete implementation).

That one structure is used as the foundation for another structure does not make it less of a structure. The key point in the data structure is that there is data, and it is structured in some way so you know where to look for its components.

added 1123 characters in body
Source Link
user40980
user40980

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in). The list can can go on and on and on (and that isn't a complete list).

Some of these things that I mentioned are fuzzy in their implementation. One can implement a Map with a hash table (backed by an array) - a HashMap, a red-black tree (a particular implementation of a balanced binary tree - just be glad its not an avl tree) as a SortedMap, or even linked lists as a ConcurrentSkipListMap. The key thing is how they behave - all of these implementations implement a set of the same methods guaranteeing they all have a get(K) and put(K, V) (along with some other things).

The linked list (concrete implementation) is a particular way of implementing a List (an abstract data type). You could also do it with a flexible array (another concrete implementation).

That one structure is used as the foundation for another structure does not make it less of a structure. The key point in the data structure is that there is data, and it is structured in some way so you know where to look for its components.

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in). The list can can go on and on and on (and that isn't a complete list).

That one structure is used as the foundation for another structure does not make it less of a structure.

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in). The list can can go on and on and on (and that isn't a complete list).

Some of these things that I mentioned are fuzzy in their implementation. One can implement a Map with a hash table (backed by an array) - a HashMap, a red-black tree (a particular implementation of a balanced binary tree - just be glad its not an avl tree) as a SortedMap, or even linked lists as a ConcurrentSkipListMap. The key thing is how they behave - all of these implementations implement a set of the same methods guaranteeing they all have a get(K) and put(K, V) (along with some other things).

The linked list (concrete implementation) is a particular way of implementing a List (an abstract data type). You could also do it with a flexible array (another concrete implementation).

That one structure is used as the foundation for another structure does not make it less of a structure. The key point in the data structure is that there is data, and it is structured in some way so you know where to look for its components.

Source Link
user40980
user40980

Alas! java.util.LinkedList is not a data structure by itself.

Does this mean that an array isn't a data structure either? or binary tree (because that's used to implement a SortedMap or a Heap)?

Ask yourself: "Is it data? is it structured?" if the answer to both of these is "yes", then, well, you have a data structure of some sort. Give the data structure Wikipedia page a read.

That a given structure is used to implement other things doesn't mean that it isn't a structure itself.

Arrays are used to implement flexible arrays. Flexible arrays are used to implement the hash table part of a map (or dictionary if your language uses that jargon instead). Linked lists may be thought of (kind of wrong, but bear with me) as specialized form of a tree (one branch only). Trees are used to implement... well, heaps, sorted maps, b trees (which are often found in indexes in). The list can can go on and on and on (and that isn't a complete list).

That one structure is used as the foundation for another structure does not make it less of a structure.