0% found this document useful (0 votes)
9 views5 pages

Lecture 01 - Introduction

The document provides an overview of data structures, defining them as methods for organizing and managing data efficiently. It classifies data structures into primitive and nonprimitive types, further dividing nonprimitive structures into linear and non-linear categories, with examples such as arrays, linked lists, stacks, queues, trees, and graphs. Additionally, it outlines basic operations that can be performed on data structures, including traversal, search, insertion, deletion, sorting, and merging.

Uploaded by

sakib2shaon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Lecture 01 - Introduction

The document provides an overview of data structures, defining them as methods for organizing and managing data efficiently. It classifies data structures into primitive and nonprimitive types, further dividing nonprimitive structures into linear and non-linear categories, with examples such as arrays, linked lists, stacks, queues, trees, and graphs. Additionally, it outlines basic operations that can be performed on data structures, including traversal, search, insertion, deletion, sorting, and merging.

Uploaded by

sakib2shaon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Data Structure Lecture Notes Lecture 01

Lecture 01

Overview of Data Structure

Data structure is a way to understand the organization of data and the management of the
data flow to increase the efficiency of any process or program.

Data Structure is a particular way of storing and organizing data in the memory of the computer
so that the data can easily be retrieved and efficiently utilized in the future when required.

The data can be managed in various ways like the logical or mathematical model for a specific
organization of data is known as a data structure.

Classification of Data Structures


The following figure shows the different classifications of Data Structures.

Primitive Data Structure

• Primitive Data Structures consist of basic data types such as numbers and characters
that are built into most programming languages.
• These data structures can be directly manipulated or operated upon using machine-
level instructions.
• Common primitive data types include Integer, Float, Character, Boolean, and
Pointer.
• They are also referred to as simple data types, as they represent atomic values that
cannot be broken down further.

Shahadat Hoshen Moz, Senior Lecturer, Dept of CSE, NUBTK


1|Page
Data Structure Lecture Notes Lecture 01

Nonprimitive Data Structure


• Non-Primitive Data Structures are those data structures derived from Primitive Data
Structures.
• These data structures can't be manipulated or operated directly by machine-level
instructions.
• The focus of these data structures is on forming a set of data elements that is
either homogeneous (same data type) or heterogeneous (different data types).
Based on the structure and arrangement of data, we can divide these data structures into two
sub-categories -
1. Linear Data Structures
2. Non-Linear Data Structures

Linear Data Structures


A data structure that preserves a linear connection among its data elements is known as a
Linear Data Structure. The arrangement of the data is done linearly, where each element
consists of the successors and predecessors except the first and the last data elements. Based
on memory allocation, the Linear Data Structures are further classified into two types:

Static Data Structures: The data structures having a fixed size are known as Static Data
Structures. The memory for these data structures is allocated at compiler time, and their size
cannot be changed by the user after being compiled; however, the data stored in them can be
altered. The Array is the best example of the Static Data Structure as they have a fixed size,
and its data can be modified later.

Dynamic Data Structures: The data structures having a dynamic size are known as
Dynamic Data Structures. The memory of these data structures is allocated at the run time,
and their size varies during the run time of the code. Moreover, the user can change the size as
well as the data elements stored in these data structures at the run time of the code.
Linked Lists, Stacks, and Queues are common examples of dynamic data structures.

Linked Lists
Linked List is a linear data structure, in which elements are not stored at a contiguous
location, rather they are linked using pointers. It forms a series of connected nodes, where
each node stores the data and the address of the next node.
Unlike arrays, linked lists allow for efficient insertion or removal of elements from any
position in the list, as the nodes are not stored contiguously in memory.
Shahadat Hoshen Moz, Senior Lecturer, Dept of CSE, NUBTK
2|Page
Data Structure Lecture Notes Lecture 01

Stacks
Stack is a linear data structure where insertion of elements and deletion of elements is done
only from one side/end. It follows the Last-In-First-Out (LIFO) principle. This means the last
element inserted inside the stack is removed first.

Queues
A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle. It
operates like a line where elements are added at one end (rear) and removed from the other
end (front).

Non-Linear Data Structures


A non-linear data structure is a type of data structure where data elements are not arranged
in a sequential or linear order. Non-linear data structures allow for more complex
Shahadat Hoshen Moz, Senior Lecturer, Dept of CSE, NUBTK
3|Page
Data Structure Lecture Notes Lecture 01

relationships between elements, where one element can be connected to multiple others. Many
real-world problems, such as family trees, organizational hierarchies, and transportation routes,
can be modeled more naturally using non-linear structures.

Trees
A tree is a hierarchical structure used to represent and organize data in the form of a parent
child relationship. It is a collection of nodes connected by edges, with one node designated as
the root.
Node: Each element in a tree is called a node. A node typically contains data and pointers to
its child nodes.
o Root: The topmost node in a tree with no parent.
o Leaf: A node that has no children.
o Internal Node: A node that has at least one child.
Edge: A connection between two nodes. If node A is connected to node B, then A is said to be
the parent of B, and B is the child of A.

Graphs
A graph can be defined as group of vertices and edges that are used to connect these vertices.
Vertices (Nodes): A vertex represents an object in the graph. Vertices are often labeled as V1,
V2, ... Vn in a graph with n vertices.
Edges (Arcs): An edge connects two vertices and represents the relationship between them.
Edges can be either directed or undirected.
Formally, a graph is a pair of sets (V, E), where V is the set of vertices and E is the set of
edges, connecting the pairs of vertices. Take a look at the following graph −

Basic Operations of Data Structures


In the following section, we will discuss the different types of operations that we can perform
to manipulate data in every data structure:
Shahadat Hoshen Moz, Senior Lecturer, Dept of CSE, NUBTK
4|Page
Data Structure Lecture Notes Lecture 01

1. Traversal: Traversing a data structure means accessing each data element exactly once
so it can be administered. For example, traversing is required while printing the names of
all the employees in a department.

2. Search: Search means to find the location of one or more data elements that meet certain
constraints. Such a data element may or may not be present in the given set of data
elements. For example, we can use the search operation to find the names of all the
employees who have the experience of more than 5 years.

3. Insertion: Insertion means inserting or adding new data elements to the collection. For
example, we can use the insertion operation to add the details of a new employee the
company has recently hired.

4. Deletion: Deletion means to remove or delete a specific data element from the given list of
data elements. For example, we can use the deleting operation to delete the name of an
employee who has left the job.

5. Sorting: Sorting means to arrange the data elements in either Ascending or Descending
order depending on the type of application. For example, we can use the sorting operation
to arrange the names of employees in a department in alphabetical order or estimate the top
three performers of the month by arranging the performance of the employees in
descending order and extracting the details of the top three.

6. Merge: Merge means to combine data elements of two sorted lists in order to form a single
list of sorted data elements.

Shahadat Hoshen Moz, Senior Lecturer, Dept of CSE, NUBTK


5|Page

You might also like