DEV Community

Cover image for Data Structures 101: Introduction to Data Structures & Algorithms
~Tracy.A.
~Tracy.A.

Posted on

Data Structures 101: Introduction to Data Structures & Algorithms

As a developer,one is required to identify a problem first and later come up with the solution for it and thus calling for the need to learn and understand the concept of Data Structures and Algorithms.In relation to this,a problem being identified first would be our input and the solution being an output.Thus inputs and outputs are the most important basics one needs to know in order to understand how a certain Algorithm works.

What is an Algorithm?
An algorithm is a well-defined sequential computational technique that accepts a value or a collection of values as input and produces output(s) needed to solve a problem.It tells the programmer the logic used to solve the problem and therefore, it is a logical step-by-step procedure that acts as a blueprint to programmers.

Types of Algorithms:
Sorting algorithms:Bubble Sort, insertion sort,et.c. These algorithms are used to sort the data in a particular format.
Searching algorithms:Linear search, binary search, etc. These algorithms are used in finding a value or record that the user demands.
Graph Algorithms:It is used to find the solutions of problems like finding the shortest path between cities, real-life problems like traveling salesman problems.

What is a Data Structure?

Just like in real life,we determine the best outfit for a certain occasion according to the type of occasion one is going to attend for example one is always expected to appear in a wedding outfit on a wedding day,a student has to dress in school uniform at school,et.c.And this is true when dealing with data structures since it requires determinig the type of data and then selecting the best data structure to help you organize data and perform certain operations on it.

Therefore,a data structure refers to a particular way of organizing data in a computer so that it can be used effectively.
Data structures can be classified as either linear or nonlinear data structures, based on how the data is conceptually organized.

Linear Data Structures

The possible operations that can be performed on a linear data structure are;Traversal, Insertion, Deletion,Searching, Sorting and Merging.
_Linear data structures include arrays, lists, queue, and stacks.Each of them is a collection that stores its entries in a linear sequence.

1.Arrays
In an array, elements in memory are arranged in continuous memory and are of the same type.For more information about arrays visit

2. Stack
In a stack data structure, elements are stored in the LIFO principle. That is, the last element stored in a stack will be removed first.It works just like a pile of plates where the last plate kept on the pile will be removed first.

3. Queue
Unlike stack, the queue data structure works in the FIFO principle where first element stored in the queue will be removed first.For example,in a queue of people for the ticket counter,the first person on the queue gets the ticket first.

4. Linked List
In linked list data structure, data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.

Non-Linear Data Structures

Non-linear data structures include;trees and graphs since data entries are not arranged in a linear sequence, but with different rules.

1.Graphs
In graph data structure, each node is called vertex and each vertex is connected to other vertices through edges.

2.Trees
Similar to a graph but a tree is also a collection of vertices and edges. However, in a tree data structure, there can only be one edge between two vertices.Common tree based Data Structures include;Binary Tree,Binary Search Tree,AVL Tree,B-Tree,B+ Tree and Red-Black Tree.
To learn more about trees visit

One can understand the strengths and weaknesses of a data structure through a mathematical concept known as Big O Notation.

Top comments (0)