DEV Community

Cover image for Introduction to Data Structures and Algorithms
Susan Wangari
Susan Wangari

Posted on

Introduction to Data Structures and Algorithms

For some of us, especially those new to programming,hearing algorithms and data structures seems like a complex thing. Well, the good news is that this article will break it down in the simplest way possible.

To elaborate on what data structures are, they are containers for storing data to allow easy manipulation. Think of them as a way of organizing data so that one is able to operate. There are different types of data structures. One type is primitive data structures.These are inbuilt data structures such as int,boolean, arrays, and objects. There are also abstract data structures are defined by a set of operations and values. They include links, trees, graphs and stacks.

To define algorithms, they are a set of instructions to help you perform an operation. An example of where one would apply algorithms is in baking a cake. You prepare the ingredients and follow a step by step process to achieve a result.

There are different properties that an algorithm possesses.

  • They include having an input. In the cake example, the input is the ingredients used to bake the cake.

  • An algorithm must also have an output. In our example, the output is the baked cake.

  • An algorithm must have every step clearly defined. For example, define all the steps involved in baking the cake.

  • Every algorithm should have a defined number of steps from beginning to the end. At some point, we have to finish baking the cake.

  • For an algorithm to be considered effective, every step should produce a correct output. For example, we cannot follow the steps of baking a cake then produce pizza, it has to be cake.

View data structures as applicable in every area of our lives and as being used to enhance our effectiveness in performing tasks.

Top comments (0)