Data Structures: What are they and how to apply them in programming?

Data Structures: What are they and how to apply them in programming?

By ESEG Team

11/05/2026

9 min read
Data Structures: What are they and how to apply them in programming?

Browse by topic

*Written by: Bruno de Abreu Iizuka Moritani, lecturer in the Computer Engineering course at ESEG College

When someone starts learning programming, it's common to pay more attention to syntax: how to declare variables, use if and for loops, create functions and classes.

But after a while, a very important question arises: How to organize program data efficiently?

This is where data structures come in. They are fundamental for a program to function well, be organized, and be able to grow without becoming a mess.

This issue arises in virtually any system. For example, a messaging app needs to store conversations and display them quickly. A streaming platform organizes thousands of movies and series.

A social network deals with profiles, connections, recommendations, and interactions on a large scale. In all these cases, it's not enough to simply have data: you need to know how to store, access, and manipulate it.

In this text, we will understand the types of data, what data structures are, their relationship with algorithms, and see how these concepts appear in practice. software development.

So, keep reading to learn more about this topic!

What is an algorithm?

An algorithm is a set of steps to solve a problem. In programming, it defines what the system should do: search for information, register a user, sort a list, remove an item, process a request.

But consider this: it's no use having a great step-by-step guide if the data is poorly organized. It's like cooking with a good recipe in a completely disorganized kitchen.

You might be able to prepare the dish, but you'll waste time looking for ingredients, utensils, and a place to work.

In computing, something similar happens. An algorithm may be correct, but if the data is stored improperly, the system can become slow, confusing, and difficult to maintain. That's why algorithms and data structures go hand in hand.

A data structure is not just for storing information. It also directly influences the operations that the system needs to perform, such as:

  • Enter data;
  • remove elements;
  • search for information;
  • browse collections;
  • reorganize content.

In other words, choosing a good data structure means making the algorithm's job easier.

Read also: What is an algorithm in programming?

What are the data types?

Data is the content, that is, what the information represents. For example:

  • Whole number → number without decimal point (number of students)
  • Real number → number with decimal point (measurement, value, grade, e.g., 8.5)
  • String/Text → student's name ("Ana", "Carlos")
  • Boolean → Student status (approved: true / failed: false)

Therefore:

  • Given = what's inside
  • Data structure = where and how is this stored

Now consider the following situation: a Computer Engineering college has many students and grades. How should this information be organized?

In a vector? In a list? In a tree?

For example, the value “8.5” could be a student's grade. That is the data. But that grade could be stored:

  • in a vector of notes;
  • in a list of students;
  • in a pile of evaluations;
  • in a tree of records;
  • in a relationship graph.

In other words: the data type is the content; the data structure is the way to organize that content so that it can be manipulated efficiently.

Want to better understand what data structures are? In the next topic, we'll explain each one.

What are the data structures?

What are the data structures?

There are various data structures, and each one is better suited to certain types of problems. Below, see what structured data is, the most common type used in the daily work of programmers.

Vectors (arrays)

Vectors - Data Structure
Figura 1 – Exemplo de um vetor de notas com números do tipo double.

Vectors, or arrays, are ordered collections of elements of the same type, accessed by an index.

Think of a row of numbered boxes: each box represents a position in the vector and holds a value. In many languages, the first index is 0.

A classic example is a vector containing the grades of a class: grades[0] stores the grade of the first student, grades[1] the grade of the second, and so on.

The main advantage of a vector is that it allows quick access to any position, as long as the index is known. On the other hand, its size is usually fixed, which can make inserting or removing elements in the middle of the collection more laborious.

Lists

Lists - Data Structure
Figura 2 – Exemplo de uma lista de compras.

Lists also store collections of elements, but in a more flexible way than arrays. In many implementations, their size can grow or shrink during execution, as new elements are added or removed.

A to-do list app is a good example: you add a new task, remove completed tasks, and rearrange the order of the items.

For beginners, it's worth keeping in mind that lists are dynamic and versatile collections, very common in the libraries of modern programming languages.

Batteries

Stacks - Data Structure
Figura 3 – Exemplo de uma pilha do histórico de um editor de texto.

A estrutura de dados – Pilhas segue o princípio LIFO (Last In, First Out): o último elemento que entra é o primeiro que sai.

The most common analogy is a stack of plates: you place one plate on top of another and, when you go to pick one up, you take the one on top first.

In practice, data structuring in stacks appears in the action history of a text editor, in the control of function calls in a program, and even in page navigation when we click "back".

The basic operations are stacking and unstacking. It's a simple structure to understand and very useful in various real-world problems.

Queues

Queues - Data Structure
Figura 4 – Exemplo de uma fila de impressão.

The queue follows the FIFO (First In, First Out) principle: the first person to enter is the first to leave. It's like a bank queue or a fast-food restaurant queue: whoever arrives first is served first.

In computer systems, queues are used in printing services, customer service systems, and various scenarios where respecting the order of arrival is important.

The main operations are enqueuing, inserting at the end, and dequeuing, removing from the beginning.

Read also: What is web programming?

Trees – data structure

Trees - Data Structure
Figura 5 – Exemplo de uma árvore da estrutura de arquivos do Windows 11.

Trees are hierarchical structures in which each element, called a node, can be linked to others at different levels. They are excellent for representing data organized in a hierarchical form.

The computer's folder structure is a very common visual example: a main folder contains subfolders, which may contain further subfolders and files.

In programming, trees appear in file systems, search engines, and structures used to efficiently organize data.

Graphs

Graphs - Data Structure
Figura 6 – Exemplo de um grafo contendo as conexões entre cidades próximas de São Paulo.

A estrutura de dados – Grafos são formados por nós, também chamados de vértices, e conexões entre eles, chamadas de arestas. Eles são ideais para representar relações e caminhos entre elementos.

A social network is a good example: each person is a node, and each friendship or connection is an edge. On maps, cities can be represented as nodes and roads as edges.

Graphs are widely used in recommendation systems, delivery routes, computer networks, and other scenarios where connections are part of the problem.

Data structures in practice

When we start programming, many of these structures already appear ready-made in the languages.

In Python, for example, lists are widely used as data structures for flexible collections. In Java, we find arrays, ArrayList, LinkedList, Stack, and Queue.

Even when a language offers ready-made structures, understanding how they work remains essential.

This happens because the programmer must not only think about "where to store it," but also about how the system will use that data.

The best structure is not the most famous or the most advanced. It's the one that best addresses the most frequent operational needs of the problem.

  • If the system needs to quickly access a specific location, the vector It could be a good choice.
  • If the focus is on frequent additions and removals, then... list That might make more sense.
  • If the problem requires an order of arrival, then queue It's natural.
  • If we need to represent hierarchies, trees They're great.
  • If the goal is to model connections, graphs They are usually the most suitable way.

In conclusion, what are the data structures?

Data structures are essential because they define how information will be organized and manipulated within a program.

They directly influence the performance, code clarity, and scalability of a system.

More important than memorizing names like vector, list, stack, queue, tree, or graph is developing the ability to analyze a problem and ask: Which structure best organizes this data for the operations I need to perform?

This is knowledge that comes up in college, in technical interviews, and in the development of real-world systems. The better we understand data structures, the better we program.

Did you like the topic? It's part of the curriculum of Computer Engineering course!

At ESEG College, part of the Etapa Group, you'll go beyond learning to program; you'll develop logical thinking and create solutions for real-world market problems.

Want to take the next step in your career? Check out the course and come study with us!

ESEG Team

Browse by topic

Share this content

Share this content

Receive our content first-hand.

Stay informed about relevant topics and what's happening at ESEG College.

Your data is safe.

What type of course are you looking for?

Make a suggestion.

Your data is safe.

Mensalidade de Estruturas de Dados: quais são e como aplicar na programação?

Unavailable

We use cookies to improve your browsing experience.