0% found this document useful (0 votes)
3 views

Unit-3 Introduction to Data Structures

The document provides an overview of data structures, explaining their purpose in organizing and storing data efficiently. It distinguishes between primitive data structures, such as integers and floats, and non-primitive data structures, like arrays and lists, while also detailing linear and nonlinear data structures, including stacks, queues, trees, and graphs. Key operations and characteristics of these structures are highlighted to illustrate their functionality and application.

Uploaded by

espinozaden45
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)
3 views

Unit-3 Introduction to Data Structures

The document provides an overview of data structures, explaining their purpose in organizing and storing data efficiently. It distinguishes between primitive data structures, such as integers and floats, and non-primitive data structures, like arrays and lists, while also detailing linear and nonlinear data structures, including stacks, queues, trees, and graphs. Key operations and characteristics of these structures are highlighted to illustrate their functionality and application.

Uploaded by

espinozaden45
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/ 2

UNIT – 3

INTRODUCTIONS TO DATA STRUCTURE

Data Structure is a way of collecting and organising data in such a way that we can
perform operations on these data in an effective way. Data Structures is about
rendering data elements in terms of some relationship, for better organization and
storage. For example, we have some data which has, player's name "Virat" and age 26.
Here "Virat" is of String data type and 26 is of integer data type.

We can organize this data as a record like Player record, which will have both player's
name and age in it. Now we can collect and store player's records in a file or database
as a data structure. For example: "Dhoni" 30, "Gambhir" 31, "Sehwag" 33

In simple language, Data Structures are structures programmed to store ordered data,
so that various operations can be performed on it easily. It represents the knowledge of
data to be organized in memory. It should be designed and implemented in such a way
that it reduces the complexity and increases the efficiency.

Primitive Data Structure

 Primitive data structures are basic structures and are directly operated upon by machine
instructions.
 Primitive data structures have different representations on different computers.
 Integers, floats, character and pointers are examples of primitive data structures.
 These data types are available in most programming languages as built-in type.
o Integer: It is a data type which allows all values without fraction part. We can use
it for whole numbers.
o Float: It is a data type which use for storing fractional numbers.
o Character: It is a data type which is used for character values.
 Pointer: A variable that holds memory address of another variable are called pointer.
Non primitive Data Type

 These are more sophisticated data structures.


 These are derived from primitive data structures.
 The non-primitive data structures emphasize on structuring of a group of homogeneous
or heterogeneous data items.
 Examples of Non-primitive data type are Array, List, and File etc.
 A Non-primitive data type is further divided into Linear and Non-Linear data structure
o Array: An array is a fixed-size sequenced collection of elements of the same
data type.
o List: An ordered set containing variable number of elements is called as Lists.
o File: A file is a collection of logically related information. It can be viewed as a
large list of records consisting of various fields.

Linear data structures

 A data structure is said to be Linear, if its elements are connected in linear fashion by
means of logically or in sequence memory locations.
 There are two ways to represent a linear data structure in memory,
o Static memory allocation
o Dynamic memory allocation
 The possible operations on the linear data structure are: Traversal, Insertion, Deletion,
Searching, Sorting and Merging.
 Examples of Linear Data Structure are Stack and Queue.
 Stack: Stack is a data structure in which insertion and deletion operations are
performed at one end only.
o The insertion operation is referred to as ‘PUSH’ and deletion operation is
referred to as ‘POP’ operation.
o Stack is also called as Last in First out (LIFO) data structure.
 Queue: The data structure which permits the insertion at one end and Deletion at
another end, known as Queue.
o End at which deletion is occurs is known as FRONT end and another end at
which insertion occurs is known as REAR end.
o Queue is also called as First in First out (FIFO) data structure.

Nonlinear data structures

 Nonlinear data structures are those data structure in which data items are not arranged
in a sequence.
 Examples of Non-linear Data Structure are Tree and Graph.
 Tree: A tree can be defined as finite set of data items (nodes) in which data items are
arranged in branches and sub branches according to requirement.
o Trees represent the hierarchical relationship between various elements.
o Tree consist of nodes connected by edge, the node represented by circle and
edge lives connecting to circle.
 Graph: Graph is a collection of nodes (Information) and connecting edges (Logical
relation) between nodes.
o A tree can be viewed as restricted graph.
o Graphs have many types:
 Un-directed Graph
 Directed Graph
 Mixed Graph
 Multi Graph
 Simple Graph
 Null Graph
 Weighted Graph

You might also like