An Algorithm a Day

Algorithms and Data Structures go hand in hand. Each algorithm works on its own data-structure at most efficiency.

Each data structure is built up of these data-types which can be categorized as following, based upon the storage:

  1. Singular Value: These are the simplest form of data structure where every entity contains just one type of value.
  2. Similar Values: These contain many values of same kind.
  3. Different Values: Contains many different types of values in a single entity.

Data Structures also differ based upon the way you can access them:

  1. Direct access: One to One mapping between variable and value.
  2. Stack Access: Map one value to next, Unidirectional access
  3. Row Access: Mapping each value against an index of variable, all access
  4. Queue Access: Mapping parent and child, linear access

Based upon these every programming language has their own implementation of data structures. Some loosely types languages give you the freedom to create your own data structures as well.

When deciding a data structure for your task, one should keep few pointers about values in mind:

  1. Types
  2. Quantity
  3. Access Mechanism