0% found this document useful (0 votes)
119 views3 pages

Overview of Data Structures Concepts

This document provides an introduction to data structures. It defines data structures as a set of rules that holds data together in defined relationships. Data structures can be linear or non-linear. Linear structures, like arrays and lists, arrange data in a straight sequence while non-linear structures, like trees and graphs, arrange data hierarchically. Abstract data types encapsulate data and operations, hiding implementation details. Common applications of data structures include searching, sorting, traversing graphs, and scheduling tasks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views3 pages

Overview of Data Structures Concepts

This document provides an introduction to data structures. It defines data structures as a set of rules that holds data together in defined relationships. Data structures can be linear or non-linear. Linear structures, like arrays and lists, arrange data in a straight sequence while non-linear structures, like trees and graphs, arrange data hierarchically. Abstract data types encapsulate data and operations, hiding implementation details. Common applications of data structures include searching, sorting, traversing graphs, and scheduling tasks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Data structures Lecture Notes Unit - I

UNIT – I
Introduction to Data Structures
1.1 Definition
 A data structure is an aggregation of atomic and composite data into a set with defined
relationships.
 Structure means a set of rules that holds data together
 Data structure can be nested
 We can have a data structure that consists of other data structures for ex, we can define the two
structures array and record as shown in table:
Array Record
Homogeneous sequence of data or data types Heterogeneous combination of data into a
known as elements single structure with an identified key
Position associated among the elements No association
Fig: Data structure examples
 Modern programming languages allow programmers to create new data structures for an
application.
Data structure
1. A combination of elements in which each is either a data type or another data structure
2. A set of associations or relationships (structure) involving the combined elements

Atomic and Composite data


 Atomic data are data that consist of a single piece of information; that is, they cannot be divided
into other meaningful pieces of data.
 The opposite of atomic data is composite data.
 Composite data can be broken into subfields that have meaning.
Data type
 A data type consists of two parts:
o A set of values
o A set of operations on values
 Table shows three data types found in all systems.
Type Values Operations
integer -∞, . . . , -2, -1, 0, 1, 2, . . . , ∞ *, +, -, %, /, ++, --, . . .
floating point -∞, . . . , 0.0, . . . , ∞ *, +, -, /, . . .
character \0, . . . , ‘A’, ‘B’, . . . , ‘a’, ‘b’, . . . , ~ <, >, . . .
Table: Three Data Types
1.2 Abstract Data Type
 When we first started programming, there were no abstract data types.
 If we wanted to read a file, we wrote the code to read the physical file device.
 It did not take long to realize that we were writing the same code over and over again.
 So we created what is known today as an abstract data type (ADT).
 We wrote the code to read a file and placed it in a library for all programmers to use.
 This concept is found in modern languages today.

1
Prepared by: G. B. Hima Bindu, Asst. Prof., Dept. of IT, SVCET, CTR
Data structures Lecture Notes Unit - I

 ADT users are not concerned with how the task is done but rather with what it can do.
 The ADT consists of a set of definitions that allow programmers to use the functions while hiding
the implementation.
 This generalization of operations with unspecified implementations is known as abstraction.
The concept of abstraction means:
1. We know what a data type can do.
2. How it is done is hidden.
 An abstract data type is a data declaration packaged together with the operations that are
meaningful for the data type.
 In other words, we encapsulate the data and the operations on the data, and then we hide
them from the user.
Abstract Data Type
1. Declaration of data
2. Declaration of operations
3. Encapsulation of data and operations
1.3 Classification of Data Structures:
 The data structure can be divided into two basic types: preliminary data structure and
secondary data structure.
 The primitive data structures are the basic data types such as int, char, float where the non
primitive data structures are the data structures which are basically derived from primitive data
structures.
 They can be further categorized into linear and non linear data structures.
 Linear data structures are the data structures in which the data is arranged in a list or a straight
sequence.
For ex: arrays, lists, stacks, queues
 Non linear data structures are the data structures in which data may be arranged in hierarchical
manner.
For ex: trees, graphs
Linear data structures:
Arrays:
An array is a group of homogeneous data which shares the same name.
List
 List is basically the collection of elements arranged in a sequential manner.
 In memory we can store the list in two ways –
o List of sequentially stored elements – using arrays
o List of elements with associated pointers – using linked lists
Stack
 A stack is a last in – first out (LIFO) data structure in which all insertions and deletions
are restricted to one end, called the top.
Queue

2
Prepared by: G. B. Hima Bindu, Asst. Prof., Dept. of IT, SVCET, CTR
Data structures Lecture Notes Unit - I

 A Queue is a list in which data can be inserted at one end, called the rear and deleted
from the other end, called the front. It is a first in first out(FIFO) restricted data
structure.
Non Linear data structures:
Trees
 A tree consists of a finite set of elements, called nodes, and a finite set of directed lines,
called branches that connect the nodes.
Graphs
 A graph is a collection of nodes, called vertices, and line segments , called arcs or edges,
that connect pairs of nodes.
1.4. Applications :
Data Structures applications are enormous. There primary purpose is to store the data most effectively.
So that they can easily accessible, modified. In most applications of data structures, we wish to perform
not just a single operations, possibly having correlated behaviour and are fundamentals of any software
application. Data Structures are used in our daily life and in many number of computer applications such
as,
 Searching
 Sorting
 Graph traversing
 Finding the shortest path from one city to another
 Resolving traffic problems
 In processing online requests or online transactions
 Alerting users of stock market prices
 Scheduling of jobs in operating systems
 Searching details of a student in a university data base
 File systems(trees)
 CPU scheduling and IO scheduling(queues)
 RAM is structured into a stack and heap
 Facebook uses trees for the sentiment analysis and other things that they do... and so on.

3
Prepared by: G. B. Hima Bindu, Asst. Prof., Dept. of IT, SVCET, CTR

Common questions

Powered by AI

ADTs in modern programming languages are implemented using encapsulation within classes or modules, defining interfaces for operations while hiding internal details. This implementation supports object-oriented principles, promoting code reuse and clarity by allowing developers to work with higher-level abstractions instead of low-level data manipulation, thereby improving robustness and reducing errors .

Abstraction allows developers to focus on what operations a data type can perform without concern for how these operations are implemented. This encapsulation helps in managing complexity and enhances code reusability by hiding the implementation details, making it easier to manage large systems .

Encapsulation in ADTs enhances software development by binding together data with the methods that manipulate it, protecting the integrity of the data and preventing unauthorized access. This modularity simplifies maintenance and updates, as modifications to the internal implementation do not affect other system parts as long as the interface remains unchanged .

Encapsulation in ADTs abstracts complex data operations behind simpler interfaces, reducing dependencies and enhancing modularity. This abstraction supports software design principles like DRY and separation of concerns, allowing developers to change implementation details without affecting the system's external behavior, thus simplifying testing and maintenance .

Linear data structures represent elements sequentially, allowing easy traversal, beneficial in tasks like sorting or simple storage, exemplified by arrays and queues. Non-linear data structures, such as trees and graphs, represent hierarchical or network connections, facilitating complex relationships like database indexing and network modeling, supporting more sophisticated operations .

Trees are hierarchical structures consisting of nodes and branches, with one node as the root and various children nodes, useful in representing file systems or organizational hierarchies. Graphs, more flexible in structure, consist of vertices and edges, capable of representing many-to-many relationships like social networks or transport systems, making them suitable for path-finding algorithms and network flow simulations .

Data structures optimize the efficiency and performance of applications by organizing data in ways that enhance accessibility and manipulation. For online transactions, data structures like queues facilitate efficient request processing in FIFO order, ensuring fairness and orderliness. In CPU scheduling, data structures are used to manage process prioritization and efficient task switching, which is crucial for minimizing latency and maximizing throughput .

The LIFO (Last In, First Out) nature of a stack makes it well-suited for algorithms requiring backtracking, like parsing expressions or navigating recursive function calls. This nature ensures that the most recently added element is processed first, which is crucial in scenarios such as function call management in program execution where the last called function needs to finish execution first .

Queues are preferable in scenarios requiring order preservation during processing, such as handling requests in a printer spooler or managing tasks in an operating system scheduler, where FIFO order ensures the oldest request is served first, contrasting the LIFO order of stacks .

Understanding the distinction helps in choosing the appropriate data structure for a given application. Atomic data represents indivisible units of information, while composite data can be decomposed, offering flexibility in organizing data hierarchically or contextually, as seen in structures like records or objects, enhancing data manipulation and retrieval efficiency .

Data structures Lecture Notes
Unit - I
UNIT – I
Introduction to Data Structures
1.1 Definition

A data structure is an aggre
Data structures Lecture Notes
Unit - I

ADT users are not concerned with how the task is done but rather with what it can do
Data structures Lecture Notes
Unit - I

A Queue is a list in which data can be inserted at one end, called the rear and dele

You might also like