This document introduces data structures and provides examples of primitive and non-primitive data structures. It defines data structures as representations of logical relationships between data elements that consider both the elements and their relationships. It classifies data structures as either primitive, which are directly operated on by machine instructions, or non-primitive, which are derived from primitive structures. Examples of linear non-primitive data structures include stacks, queues, and linked lists, while non-linear structures include trees and graphs. The document also distinguishes between primitive and non-primitive data structures and provides examples of linear data structures.
2. Definition
2
Data: Collection of raw facts.
Data structure is representation of the logical
relationship existing between individual
elements of data.
Data structure is a specialized format for
organizing and storing data in memory that
considers not only the elements stored but also
their relationship to each other.
3. Introduction
Prof. K. Adisesha 3
Data structure affects the design of both
structural & functional aspects of a program.
Program=algorithm + Data Structure
You know that a algorithm is a step by step
procedure to solve a particular function.
4. Classification of Data Structure
4
Data structure are normally divided into
two broad categories:
◦ Primitive Data Structure
◦ Non-Primitive Data Structure
6. Primitive Data Structure
6
There are basic structures and directly
operated upon by the machine instructions.
Data structures that are directly operated
upon the machine-level instructions are
known as primitive data structures.
Integer, Floating-point number, Character
constants, string constants, pointers etc, fall
in this category.
7. Primitive Data Structure
7
The most commonly used operation on data
structure are broadly categorized into
following types:
◦ Create
◦ Selection
◦ Updating
◦ Destroy or Delete
8. Non-Primitive Data Structure
8
There are more sophisticated data
structures.
The Data structures that are derived from the
primitive data structures are calledNon-primitive
data structure.
The non-primitive data structures
emphasize on structuring of a group of
homogeneous (same type) or heterogeneous
(different type) data items.
9. Non-Primitive Data Structure
9
Linear Data structures:
◦ Linear Data structures are kind of data structure that has homogeneous
elements.
◦ The data structure in which elements are in a sequence and form a liner
series.
◦ Linear data structures are very easy to implement, since the memory of the
computer is also organized in a linear fashion.
◦ Some commonly used linear data structures are Stack, Queue and Linked
Lists.
Non-Linear Data structures:
◦ A Non-Linear Data structures is a data structure in which data itemis
connected to several other data items.
◦ Non-Linear data structure may exhibit either a hierarchical relationship or
parent child relationship.
◦ The data elements are not arranged in a sequential structure.
◦ The different non-linear data structures are trees and graphs.
10. Non-Primitive Data Structure
10
The most commonly used operation on data
structure are broadly categorized into
following types:
◦ Traversal
◦ Insertion
◦ Selection
◦ Searching
◦ Sorting
◦ Merging
◦ Destroy or Delete
11. Different between them
11
A primitive data structure is generally a
basic structure that is usually built into the
language, such as an integer, a float.
A non-primitive data structure is built
out of primitive data structures linked
together in meaningful ways, such as a or
a linked-list, binary search tree, AVLTree,
graph etc.
12. Linear And Non Linear Data Structure
s
Main difference between linear and nonlinear data structures lie in the wa
y they organize data elements.
In linear data structures, data elements are organized sequentially and ther
efore they are easy to implement in the computer’s memory.
In nonlinear data structures, a data element can be attached to several oth
er data elements to represent specific relationships that exist
among them.
Due to this nonlinear structure, they might be difficult to be implemen
ted in computer’s linear memory compared to implementing linear da
ta structures. Selecting one data structure type over the other should
be done carefully by considering the relationship among the data ele
ments that needs to be stored.
13. Linear Data Structure
1. Array
2. Stack
3. Queue
4. Linked List
1. Array
An array is a collection of homogeneous type of data elements.
An array is consisting of a collection of elements
Array Representation