Data Structures 101: Introduction to Data Structures & Algorithms
Tags: luxtechacademy, dsea, datastructure, technology
Published: 2022-06-28 13:47:33

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 [](https://www.youtube.com/watch?v=OnPP5xDmFv0)

_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 [](https://www.geeksforgeeks.org/introduction-to-tree-data-structure/)

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