Learn Data structures from scratch-A success guide for better results

In this tutorial, we will discuss about data structures from the basics. We will understand the different types of data structures and their uses and how we can implement them.

What is data structure?

A data structure is a collection of data that can be stored in an organised manner so that the data can be accessed, modified efficiently.

Data Structures usages

  1. Data structures are used in different kinds of applications like relational databases, which use B-tree indexes to retrieve the data.
  2. Hash table is used in compiler design.
  3. These are used in different algorithms like searching, sorting.
  4. Internet indexing service uses data structures.

Types of the Data structures

Types of DSSub type
LinearArray
Linked List
Stack
Queue
TreeBinary Tree
Binary Search Tree
Heap
HashingHash Table
Hash Tree
GraphDecision Graph
Directed graph
Matrix

What is Linear data structure ?

A linear data structure is a type of data structure where data can be traversed sequentially. Array, Linked list, stack, queue are examples of linear data structure. Please go through below image for the details:

Linear data structures
Linear data structures

What is Tree Data Structure

A tree data structure is a hierarchical data structure. It has nodes that are connected by edges.Please go through below image for the details:

Example of tree

What is hashing

Hashing is a data structure which uses a hash function to map the data in a key-value pair to retrieve the data faster. Examples of Hashing are Hash table, Hash tree. Please go through below image for the details:

Example of Hashing

What is graph

A Graph is a non-linear, pictorial representation of data consisting of edges and vertices. Please go through below image for the details:

example of graph

Difference between linear and non-linear data structure

Sl NoKey pointsLinear data structureNon-linear data structure
1Data alignmentData gets stored  sequentially Data gets stored in hierarchy form
2LevelsSingle level involvedMultiple level involved
3ComplexityEasy to implementImplementation is complex
4TraversalData can be traversed in single runData cannot be traversed in a single run rather need multiple runs
5Utilisation of memoryNot efficientEfficient
6ExamplesArray, Linked list, stack, queueGraph, tree
7ApplicationUsed in software developmentUsed in Image Processing, Voice Processing, Artificial Intelligence 
DS flowchart

Some import Questions and Answers on Data Structure

Qn 1. What do you mean by ADT in Data structure?

Ans: ADT means Abstract Data type. Class or Objects are an example of ADT. When We use and Class or Object, we define the behavior by a set of values and a set of operations. ADT only tells us what operation has to perform. It does not tell us how the operation has been internally implemented.

For Example :

  • List
    • size() -> Size gives us the number of elements, but it does not show how internally it calculates to give the result.
    • insert(x) -> insert helps us to insert the element but does not tell how the logic is written.
    • remove(x) -> Similarly remove method is used to remove the elements without telling the implementation.
    • get(i) -> get is used to access the elements.

Qn 2. What are the advantages of data structure?

  1. Ans:
  2. Using Data Structure, we can efficiently store data in a storage device.
  3. Data structure gives an easy option to retrieve the data from a storage device.
  4. It can process small as well as large numbers of data efficiently
  5. Using data structures like graph we can solve real-life problems
  6. Database systems uses indexing using a hash table and array to retrieve the data efficiently.

Qn 3. What is primitive data structure?

Ans: Primitive data structures are system-defined data types supported by different programming languages. Example: int, double, float, boolean, character.

Qn 4. What is a Complex Data structure?

Ans: Data structures like Hash table, Tree, Heap, Graph are called a complex data structure. The implementation of these data structures is complex in nature.

Qn 5. What are the two main types of data structure?

Ans: Mainly, data structures are divided into two parts:

  1. Linear Data structure: Stack, Queue, Array, Linked List
  2. Non-linear Data Structure: Tree, Graph

Conclusion

Till now, We have covered the basics of Data Structure. In the next topic, we will write about the Array. For more details for this section, please refer to this link.

LOW SUPERHEAT | IMPORTANT TERMS & 3 FAQS

Content DEFINITION OF LOW SUPERHEAT | LOW SUPERHEAT CAUSESLOW SUPERHEAT LOW SUBCOOLING | CAUSES, AND REMEDY FOR LOW SUPERHEAT AND LOW SUBCOOLING | LOW SUPERHEAT LOW SUBCOOLING 410ALOW SUPERHEAT NORMAL SUBCOOLINGHOW TO RAISE OR LOWER SUPERHEAT?LOW DISCHARGE SUPERHEAT ALARM | CAUSES OF LOW DISCHARGE SUPERHEAT | WHAT CAUSES LOW DISCHARGE SUPERHEATA LOW EVAPORATOR SUPERHEAT INDICATESHIGH…

Continue Reading LOW SUPERHEAT | IMPORTANT TERMS & 3 FAQS

Puppeteer Browser Class – An Excellent Learning Guide of Puppeteer Tutorial 8

Puppeteer is an open-source node js library and is used a web automation as well as web scraping tool. You need the basic understanding of Javascript, and HTML DOM structure to start working with Puppeteer. This Puppeteer tutorial series is distributed in the below segments which will equip you with all the necessary experience to…

Continue Reading Puppeteer Browser Class – An Excellent Learning Guide of Puppeteer Tutorial 8

Puppeteer Class – An Excellent Learning Guide of Puppeteer Tutorial 7

Puppeteer which is an open-source node js library, can be used as a web scraping tool. Understanding of command line, Javascript, and HTML DOM structure should be good to start with this puppeteer tutorial. The Series of Puppeteer tutorial is distributed among below Sub section to get a good hold on Puppeteer.  Puppeteer Tutorial Tosca…

Continue Reading Puppeteer Class – An Excellent Learning Guide of Puppeteer Tutorial 7

Tosca Automation Tool – An Excellent Learning Guide for Tosca 13.x

Tosca Tutorial – Table of Content Tosca Tutorial #1: Tosca Overview Tosca Tutorial #2: Tosca Automation Overview Tosca Tutorial #3: Tricentis Tosca Setup – Install, Uninstall and License Configuration Tosca Tutorial #4: Tosca Workspace Creation Tosca Tutorial #5: Understanding of TOSCA Commander and Tosca User Management Tosca Tutorial #6: Tosca Scanning – An Introduction to Modules Tosca Tutorial #7: Tosca Test Case Creation Tosca Tutorial #8: Tosca Parameters and Library– Buffer, Business Parameter, TCP Tosca Tutorial #9:Tosca Test…

Continue Reading Tosca Automation Tool – An Excellent Learning Guide for Tosca 13.x

Puppeteer Automation Testing – An Excellent Guide of Puppeteer Tutorial 6

The Puppeteer is a node js library based framework which is available as open-source. It can be used for web scraping tools. It’s also used for test automation tools as well. Now-a-days, the usage of Puppeteer is getting increased rapidly in the automated software testing space. Basic knowledge of command line, Javascript, and HTML DOM…

Continue Reading Puppeteer Automation Testing – An Excellent Guide of Puppeteer Tutorial 6

Install Puppeteer – An Excellent Learning Guide of Puppeteer Tutorial 4 & 5

Puppeteer is an open-source node js library that can be used for web scraping tools. It can also be used to perform test automation in web applications. Now-a-days, the usage of Puppeteer is getting increased rapidly in the automated software testing space. Basic knowledge of command line, Javascript, and HTML DOM structure is required to…

Continue Reading Install Puppeteer – An Excellent Learning Guide of Puppeteer Tutorial 4 & 5

About Himadri Das

Hi, I am Himadri Das, I am a blogger, and an open source contributor. I have about 11 years of experience in the Information Technology domain. Currently I am working in a Startup Company as Quality Assurance Manager. I have hands-on experience on Appium, Selenium, QTP, Locust, Automation framework, Performance Testing, Functional Testing, Java, python, Shell scripting, MySql, Redis, Kafka etc. Apart from my work and writing blogs, I love to play guitar, love to travel and love to watch cricket and football. If you want to know more about me, please visit my linkedin profile - https://www.linkedin.com/in/himadri-das-2b6b7421/.