Data Structures Tutorial

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

  • 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

  • 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