Data Structures and Algorithms (DSA)

A systematic approach for problem solving.

Posted by marcelo on January 17, 2023

Every software engineer should know about Data Structures and Algorithms because these subjects are the essential toolbox of our craft.

Algorithms go hand in hand with data structures, which is why they are taught together.

What is an Algorithm?


An algorithm is a finite set of unambiguous instructions to solve a problem.

We can give an algorithm in many ways, like a diagram or in a natural language like English. However, the software engineer is interested in algorithms specified in an appropriate mathematical formalism, such as programming languages.

There are multiple algorithms for solving the same problem. Algorithm Analysis helps us to determine which algorithm is the most efficient in terms of time and space consumed.

What is a Data Structure?


A data structure is a way of organizing data for algorithms to process them efficiently.

Variables


A variable is a name that holds a value.

Example:

x = 10

Computer programs operate over data stored in computer memory, but writing programs that work directly with memory positions is hard for humans. We are all familiar with variables in algebra equations, where letters like x and y represent values in expressions. So, using variables was the way computer scientists found to make data representation easier in algorithms.

Algorithm Design


When creating an algorithm, the main concern is to find out if it is correct, i.e., if it gives a solution in a finite number of steps. Then we can analyze it according to its efficiency, i.e., how much memory and time it takes to execute it.

Work in progress. Updated on 1/8/2