Data Structures 101: Introduction to Data Structures and Algorithms.

Data Structures 101: Introduction to Data Structures and Algorithms.

This will be a brief summary into getting to understand the topic.

Data are values or a set of values while structure is the arrangement of things in a particular way. Therefore, data structures is the collection and grouping of data to run them effectively. It constitutes of the knowledge of data to be organized in memory.

Algorithms on the other hand are instructions that solve a problem.

Types of Data Structures:

  • Built-in: These are in the system and such as Integer, Float, Character or Boolean.
  • User-defined: These are created and varied by the user.

Classifications of Data Structures

  1. Dynamic - Memory location changes depending on the program. This is because it is allocated at the run time.
  2. Static - Have fixed memory locations. This is because it is allocated at the compile time
  3. Linear - Data items are arranged in a progressive order. Eg: Array
  4. Non-linear - Data items are not arranged in order. Eg: Tree, Graph

Properties of an Algorithm

  • Input: Have at least one input.
  • Output: Generate an output.
  • Concise: Each step should be brief and clear.
  • Correctness: Produce the accurate result.
  • Effective: Return the desired result.
  • Finiteness: Process should stop after completion of steps.

Time complexity is the amount of time required by the program to run till its completion. Best to keep the time required to a minimum for the best efficiency.

Space complexity is the amount of memory space required by the program to execute.