What are Data Structures?
A data structure is a way of organizing data in a computer so it can be used. Each data structure is best suited for specific application types and tasks. Data structures make it possible to manage large amounts of data. They are also important for designing algorithms. Some of the data structures include; array, graph, hash table, union, tagged union, set, graph, and object.
Why & How do we use Data Structures?
Review each data type to get a better understanding of why each one is used. More data structures than this exist, but they are variations and compounds of the following data structures.
-
Array Data Structure
- a number of elements in a specific order.
- Integer is used to access specific elements.
- Elements can be almost any type.
- Fixed-length or Expandable.
- See Java Array Tutorial
-
Dictionary Data Structure
- legacy Java class.
- See Map Data Structure Tutorial
-
Graph Data Structure
- Linked abstract data structures composed of nodes.
- Each node contains a value & one or more pointers to other nodes.
Graphs can be used to represent networks.
-
Hash Table Data Structure
- legacy Java class.
- more flexible variation of a record where name-value pairs can be freely added & deleted.
- see Map Data Structure
-
Map Data Structure
- also called Dictionary.
- also called Hash Table.
- see Map Data Structure tutorial
-
Object Data Structure
- contains data fields like a record plus program code fragments to access or modify those fields.
-
Records Data Structure
- also called tuples.
- also called structs.
- a value that holds other values.
- usually holds fixed number & sequence.
- usually indexed by names.
- record elements are usually called fields or members.
-
Set Data Structure
- an abstract data structure.
- stores specific values in no specific order and no repeated values.
- values are not retrieved from sets – instead we test a value for membership to get a boolean “in” or “not in”.
-
Tagged Union Data Structure
- also called a variant.
- also called a variant record.
- also called a discriminated union.
- also called a disjoint union.
- contains another field to indicate it’s current type.
- enhanced type safety.
-
Tree Data Structure
- Linked abstract data structures composed of nodes.
- Each node contains a value & one or more pointers to other nodes.
- Trees can be used for sorting and searching.
- Trees have nodes arranged in relative order based on their values.
-
Union Data Structure
- specifies permitted primitive types that are allowed to be stored in it’s instance. (example: long integer or string).
- enough space is allocated to allow the widest member datatype.
- their is only one value at a time (unlike a record that can contain a float and an integer).
References
retrieved August 27th, 2014
- Back to Basics. Perfect your Notetaking techniques.
- CS16: Algorithms and Data Structures.
- Data structure.
- Data structures free video tutorials.
- Data Structures fundamental tools.
- Hints for Good Notetaking
- How do I strengthen my knowledge of Data Structures and Algorithms?
- Intro to Data Structures & Algorithms in Java. udemy
- Java Array Images.
- Java Dictionary Images.
- Java Graph Images.
- Java Hash Table Images.
- Java Map Images.
- Java Object Images.
- Java Record Images.
- Java Set Images.
- Java Tagged Union Images.
- Java Tree Images.
- Java Union Images.
- Java 101: Data structures and algorithms, part 1.
- MIT Open Courseware. Intro to Algorithms.
- YouTube Search for key words in this post to find great video tutorials.