Introduction to Data Structures and Algorithms

Introduction to Data Structures and Algorithms

Introduction to Data Structures and Algorithms. Welcome to the introduction to data structures tutorial. Have you ever used a DVD case to store multiple DVDs or even a simple register used to store data manually? Both of the above real-life examples are a form of data structures.

Introduction to Data Structures and Algorithms

Welcome to the introduction to data structures tutorial. Have you ever used a DVD case to store multiple DVDs or even a simple register used to store data manually? Both of the above real-life examples are a form of data structures.

Here DVDs in a DVD case and records in the register are examples of data and their arrangement in a particular structure makes them more easily accessible. Combining a similar concept with the digital world gives us data structures in computers.

A set of data in mathematics might be unchanging but in computers, they can grow, shrink or change with the use of algorithms. These are dynamic sets.

What is a Data Structure?

A data structure is a specific way of arranging the data in a computer so that its usage is more effective and efficient.

  • Data structures are a set of algorithms.
  • They are useful to store data in a way that makes it extremely accessible and easy to manipulate

Basic Terminologies of Data Structure

Here are a few standard terms that we will be using frequently in our Data Structure’s learning journey:

1. Data: Data is the elementary value or we can also say that it is a collection of values. For example, employee name and employee ID are data about an employee.

2. Group Item: Data items having sub-data items are known as group items. For example, names. I can have the first name and surname of the employee.

3. Record: Record is the collection of various data items. For example in the case of employee data, the record might consist of name, address, designation, pay scale, and working hours.

4. File: A file is a collection of multiple records of the same entity. For example, a collection of 500 employee records is a file.

5. Entity: Entity is a class of certain objects. Each entity has various attributes.

6. Attribute: Each attribute represents a particular property of the entity.

7. Field: Field is an elementary unit of the information that represents the attribute of an entity.

Types of Data structures

There are 2 types of data structures:

1. Primitive data structure

A primitive data structure or data type is defined by a programming language and the type and size of the variables, values are specific to the language. It does not have any additional methods. For example int, float, double, long, etc. These data types can hold a single value.

2. Non-primitive data structure

These data structures are defined by the programmers and not by the programming languages. These data structures can hold multiple values and make them easily accessible.

Non-primitive data structures can further be classified into two types:

a. Linear Data Structure

In the linear data structure, as the name suggests, data elements are arranged sequentially or linearly where each element is in connection with its previous and next element.

Since a single level is involved in a linear data structure, therefore, the whole data structure is traversable through all the elements in a single run only. These data structures are easy to implement. For example array, linked list, stack, and queue.

b. Non-linear Data Structure

In a non-linear data structure, the elements’ arrangement is not sequential or linear. Instead, they are arranged hierarchically. Hence we cannot traverse through each element in one run. 

Non-linear data structures are a little bit more difficult to implement than linear data structures but they use computer memory more efficiently compared to linear data structures. For example graphs and trees.

Data structures classification can also be done in the following two categories :

  • Static data structures
  • Dynamic data structures
1. Static Data Structure

Static data structures have a specific memory size, the allocation of which is done at the time of compilation. Therefore, these data structures have fix memory size.

An array is the best example of static data structure.

2. Dynamic Data Structure

Dynamic data structures have flexible memory sizes since the memory allocation is done at the run time. Hence, dynamic data structures can shrink or grow as and when required by deallocating or allocating the memory respectively.

For example, linked lists, stack, queue, graphs, and trees are dynamic data structures.

data structure tutorials basics of data structures introduction to data structures

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Your Data Architecture: Simple Best Practices for Your Data Strategy

Your Data Architecture: Simple Best Practices for Your Data Strategy. Don't miss this helpful article.

Stacks In Data Structures | Introduction To Stack | Data Structure Tutorial

This video is based on Stacks in Data Structures. This video will help the beginners with a detailed introduction to Stack. This Data Structure tutorial has an end-to-end Stack Data structure practical demo for a better learning experience.

Queue In Data Structure | Introduction To Queue With Example | Data Structures Tutorial

This video on Queue In Data Structure will acquaint you with all the basics of Queue data structure from scratch. In this introduction to queue with example video we will provide you with algorithms of queue operations to make you understand the flow of data. You will also understand the importance of queue data structure through its various applications. So, let's begin!

An Introduction to Data Connectors: Your First Step to Data Analytics

This post explains what a data connector is and provides a framework for building connectors that replicate data from different sources into your data warehouse

Data Structures Easy to Advanced Course - Full Tutorial from a Google Engineer

Learn and master the most common data structures in this full course from Google engineer William Fiset. This course teaches data structures to beginners using high quality animations to represent the data structures visually. You will learn how to code various data structures together with simple to follow step-by-step instructions. Every data structure presented will be accompanied by some working source code (in Java) to solidify your understanding.