Data Structure

   Not to be [1]confused with [2]data type.

   Data structure refers to a any specific way in which [3]data is organized
   in computer memory, which often comes with associated efficient operations
   on such data. A specific data structure describes such things as order,
   relationships (interconnection, hierarchy, ...), helper values
   ([4]checksum, [5]indices, ...), formats and [6]types of parts of the data.
   [7]Programming is sometimes seen as consisting mainly of two things:
   design of [8]algorithms and data structures these algorithm work with.

   As a programmer dealing with a specific problem you oftentimes have a
   choice of multiple data structures -- choosing the right one is essential
   for performance and efficiency of your program. As with everything, each
   data structure has advantages and also its downsides; some are faster,
   some take less memory etc. For example for a searchable database of text
   string we can be choosing between a [9]binary tree and a [10]hash table;
   hash table offers theoretically much faster search, but binary trees may
   be more memory efficient and offer many other efficient operations like
   range search and sorting (which hash tables can do but very
   inefficiently).

   What's the difference between data structure and (a potentially
   structured/complex) [11]data type? This can be tricky, in some specific
   cases the terms may even be interchanged without committing an error, but
   there is an important difference -- data structure is a PHYSICAL
   ORGANIZATION of data and though it's often associated with operations and
   algorithms (e.g. a binary tree comes with a natural search algorithm), the
   stress is on the layout of data in memory; on the other hand data type can
   be seen as a more abstract term defined by a SET OF ALLOWED VALUES and
   OPERATIONS on those values, usually without paying much attention to how
   those values and operations internally work, although in practice of
   course we rarely ignore this and often talk about a data type as being
   connected to specific data structure, which may be where the confusion
   comes from (also struct is a name of a data type in some languages,
   something potentially confusing as well). For example an ASCII text string
   is a data type, its set of values are all possible sequences of ASCII
   symbols and operations it allows are e.g. concatenation, substring search,
   substring replacement etc. This specific data type can be internally
   implemented differently, though one of the most natural ways is a "zero
   terminated string", i.e. [12]array of values that always ends with value
   zero -- this is A DATA STRUCTURE. Because string, a data type, and zero
   terminated string (an array of values) are so closely connected, we may
   sometimes hear a string being called both a data type and data structure.
   However consider another example: a [13]dictionary -- this is a DATA TYPE,
   very frequently used e.g. in [14]Python, which allows storage of pairs of
   values; again dictionary itself is a data type defining only "how it
   behaves on the outside", but it can be implemented in several ways, for
   example with [15]trees, [16]hash tables or [17]arrays, i.e. different DATA
   STRUCTURES. Different Python implementations will all offer the same
   dictionary data type but may use a different underlying data structure for
   it.

Specific Data Structures

   These are just some common ones:

     * [18]array
     * [19]binary_tree
     * [20]bitfield
     * [21]blockchain
     * [22]B+ tree
     * [23]circular buffer
     * [24]directed acyclic graph
     * [25]graph
     * [26]hash table
     * [27]heap
     * [28]linked list
     * [29]N-ary tree
     * pascal [30]string
     * [31]record
     * [32]stack
     * zero terminated [33]string
     * [34]tree
     * [35]tuple
     * [36]queue
     * ...

See Also

     * [37]data
     * [38]data type

Links:
1. often_confused.md
2. data_type.md
3. data.md
4. checksum.md
5. index.md
6. data_type.md
7. programming.md
8. algorithm.md
9. binary_tree.md
10. hash_table.md
11. data_type.md
12. array.md
13. dictionary.md
14. python.md
15. tree.md
16. hash_table.md
17. array.md
18. array.md
19. binary_tree.md
20. bitfield.md
21. blockchain.md
22. bplus_tree.md
23. circular_bugger.md
24. dac.md
25. graph.md
26. hash_table.md
27. heap.md
28. linked_list.md
29. nary_tree.md
30. string.md
31. record.md
32. stack.md
33. string.md
34. tree.md
35. tuple.md
36. queue.md
37. data.md
38. data_type.md