DEV Community

Cover image for Data Structures 101: Introduction to Data Structures and Algorithms.
Ukpai Chukwuemeka
Ukpai Chukwuemeka

Posted on

Data Structures 101: Introduction to Data Structures and Algorithms.

What is Data Structure?

A data structure is a named location that can be used to store and organise data. And, an algorithm is a collection of steps to solve a particular problem.

Learning data structures and algorithms allow us to write efficient and optimised computer programs.

What is an Algorithm?

An algorithm is a set of well-defined instructions to solve a particular problem. It takes a set of inputs and produces the desired output.
For example;
An algorithm to add two numbers:
Take two number inputs
Add numbers using the + operator
Display the result

Qualities of Good Algorithms

  1. Input and output should be defined precisely.
  2. Each step in the algorithm should be unambiguous.
  3. Algorithms should be the most effective among many different ways to solve a problem.
  4. An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.

Data structure helps us understand the working of each data structure. And, based on that you can select the right data structures for your project.

Top comments (0)