Getting Started With Data Structures And Its Types

Introduction

In this article, we will discuss in detail about the Data Structures and the types of Data Structures. We all know present days Data structure is currently playing an important role in the Software industry and its good to know how the things are working around in day to day life.

Topics to be covered

  • What is Data Structure
  • Primitive Data Structure
  • Non Primitive Data Structure

 Linear 

  • Arrays
  • Linked List
  • Stack
  • Queue

Non Linear

  • Tree
  • Graph

Data Structure

Data structure is a way to store organised data so that it can be used efficiently. Primitively Data structure is not any programming language like C, C++, Java and my most favorite C# and many more etc. It is a set of algorithm that is used in almost all the programming lanugages. Data can be arranged in many ways like logical or mathematical arrangement of data is also known as Data structure.

Primitive Data Structure

The primitive data structure are nothing but the primitive data types and here comes the data types are int, char, float, double, and pointer are the primitive data types that comes under the primitive data structure and that can hold the single value.

Non Primitive Data Structure

The non Primitive data types comes under this data structure and they are class, object, array, string and interface are the non primitive data structures. Let us see each of the non primitive types in detail.

Arrays

Arrays are defined as a collection of similar types of data items stored in a continuous memory location. Arrays are known as the simplest data structure where each data element can randomly accessed by using its index number.

 arr -> array variable 

[0,1,2] -> index of element

Linked List

A linked list is a data structure that contains sequence of nodes where every node is connected to the next node by its reference pointer in its own way.

 Each nodes contains two parts

  1.  Data field
  2. A reference of the next node

Stack

A stack is a linear data structure that follows the LIFA principle approach for accessing each element. LIFA stands for Last in First Out. The basic operations in stack are Push, Pop, Peak (or Top). We use stack in our day to day regular development phase.

  1. Problem of infix to postfix.
  2. reverse a string. 
  3. evaluating postfix expression.
  4. check for balance parenthesis in an expression.

Queue

A queue can be defined by as an ordered list which enables insert operation to be performed and one end called the Rear end and other Delete operation can be performed by another end called as Front. Queue is referred to as the First in First Out (FIFA).

Tree

A tree is a data structure that represents hierarchy of the data. A tree data can be defined recursively as a collection of nodes, where each node is a list of reference to that node.

Graph

A graph can be defined as a group of nodes that are known as vertices and edges and that are used to connect that vertices.

Conclusion

Thank you for reading, I hope this article gives you a basic understanding the idea about the data structures and their types with clear examples.

Please let me know your questions, thoughts, or feedback in the comments section. I appreciate your feedback and encouragement.

Keep learning ...!