SlideShare a Scribd company logo
1 of 35
Sparkling Beelzebub
Group Members :
1)Muhammmad Mazhar Mustafa Shahid
2)Hassan Ahmed
3)Imran Farooq Mughal
4)Hafiz Salman Majeed
5)Hafiz Muhammad Hamza
Submitted To Respected Mam Sobia Sarwar
Topics:
1.Basic data structures
2.Static and dynamic data structures
3.Abstraction and ADT’s
4.Time and space requirements of various
implementation of ADT’s
Basic Data Structure
Basic data structure
In Computer science
daIn ta structure is a particular way of storing and organizing data in computer
so it can be efficiently
.
*Objectives
..
*We use this
· To understand the abstract data types stack, queue, deque, and list.
To understand the performance of the implementations of basic linear data
structures.
· To understand prefix, infix, and postfix expression formats.
· To use stacks to evaluate postfix expressions.
· To use stacks to convert expressions from infix to postfix.
· To use queues for basic timing simulations.
*and many more
.
b) LINEAR DATA STRUCTURES
.
THAT IS THE SIMPLIST FORM OF DATA STRUCTURES
..
Stacks, queues, deques, and lists are examples of data collections whose items are ordered
depending on how they are added or removed.
Once an item is added, it stays in that position relative to the other elements that came before
and came after it. SUCH SORT OF Collections are often referred as linear data STRUCTURES
.
Linear structures can be thought of as having two ends. Sometimes these ends are referred to as
the “left” and the “right” or in some cases the “front” and the “rear.” You could also call them the
“top” and the “bottom.”
The names given to the ends are not significant. What distinguishes one linear structure from
another is the way in which items are added and removed. in particular the location where
these additions and removals occur. For example, a structure might allow new items to be
added at only one end. Some structures might allow items to be removed from either end.
A stack (sometimes called a “push-down stack”) is an ordered collection of
items where the addition of new items and the removal of existing items
always takes place at the same end. This end is commonly referred to as
the “top.” The end opposite the top is known as the “base.”
The base of the stack is significant since items stored in the stack that are
closer to the base represent those that have been in the stack the longest.
The most recently added item is the one that is in position to be removed
first. This ordering principle is sometimes called LIFO, last-in first-out. It
provides an ordering based on length of time in the collection. Newer
items are near the top, while older items are near the base.
Many examples of stacks occur in everyday situations. Almost any
cafeteria has a stack of trays or plates where you take the one at the top,
uncovering a new tray or plate for the next customer in line. Imagine a
stack of books on a desk
The only book whose cover is visible is the one on top. To access
others in the stack, we need to remove the ones that are sitting on top
of them.
Considering this reversal property, you can perhaps think of
examples of stacks that occur as you use your computer. For
example, every web browser has a Back button. As you navigate from
web page to web page, those pages are placed on a stack (actually it
is the URLs that are going on the stack). The current page that you
are viewing is on the top and the first page you looked at is at the
base. If you click on the Back button, you begin to move in reverse
order through the pages.
As an element enters the queue it starts at the rear and makes its way
toward the front, waiting until that time when it is the next element to
be removed.
A queue is an ordered collection of items where the addition of new
items happens at one end, called the “rear,” and the removal of existing
items occurs at the other end, commonly called the “front.”
The most recently added item in the queue must wait at the end of
the collection UNTILL a next elements comes in. This ordering
principle is sometimes called FIFO, first-in first-out
Example printing process
What Is a Deque?
A deque, also known as a double-ended queue, is an ordered collection of
items similar to the queue. It has two ends, a front and a rear, and the
items remain positioned in the collection.
What makes a deque different is the unrestrictive nature of adding and
removing items. New items can be added at either the front or the rear.
Likewise, existing items can be removed from either end

It is important to note that even though the deque can assume many of the
characteristics of stacks and queues, it does not require the LIFO and FIFO
orderings that are enforced by those data structures. It is up to you to
make consistent use of the addition and removal operations.
What is Lists?
The list is a powerful, yet simple, collection OF mechanism that provides the
programmer a wide variety of operations. However, not all programming
languages include a list collection.
A list is a collection of items where each item holds a relative position with
respect to the others.WE CAN SAY THAT IT’S A SYMITRICAL ARRANGMENT
OF ITEMS.
we will refer to this type of list as an unordered list. We can consider the list
as having a first item, a second item, a third item, and so on. ). For simplicity
we will assume that lists cannot contain duplicate items.
For example, the collection of integers 54, 26, 93, 17, 77, and 31 might
represent a simple unordered list of exam scores. Note that we have written
them as comma-delimited values, a common way of showing the list
structure. [54,26,93,17,77,31].
Static and Dynamic
Data Structure
Data Structure is a way of storing
and organizing data, effectively.
There are two major categories of
Data Structures called ˜’Static
Structures’ and ‘˜Dynamic
Structures’.
Static Data Structures
As same as the word static suggests, static data
structures are designed to store static “set of data”.
However, static “set of data”, doesn’t mean that we can
not change the assigned values of elements. It is the
memory size allocated to “data”, which is static. So
that, it is possible to change content of a static
structure but without increasing the memory space
allocated to it.
Dynamic Data Structures
Dynamic data structures are designed to facilitate
change of data structures in the runtime. It is
possible to change the assigned values of elements, as
it was with static structures. Also, in dynamic
structures the initially allocated memory size is not a
problem. It is possible to add new elements, remove
existing elements or do any kind of operation on data
set without considering about the memory space
allocated initially.
Difference Between Static and Dynamic
Data Structure
Static data structure is given a fixed area of memory
which it can operate within. It is not possible to
expand this fixed size in the run time. So that,
locations of each element is fixed and known by the
program. Dynamic data structure also has an area
where it can operate. However, this size of the area is
flexible, not fixed as it was with static data structures.
It is possible to increase or decrease the area as
required, by adding or removing elements from data
structure.
From here onwards an example of a static array and a
dynamic linked list, will be considered to discuss differences.
Insertions and Removals
As discussed earlier, static structure has fixed sizes. It
is possible to remove the value of an element, but the
element is still there in the structure. Only difference
is that element doesn’t contain any data. Such removal
is not going to free the memory occupied by the
element and can be considered as a waste of resources.
What about adding new elements to a static structure? As you already
know it is not possible because static data structure has a fixed size. In
order to add new element, we should create a new static structure
with number of elements required and move the data from existing
structure to new structure and assign additional elements with
required values.
As discussed earlier, dynamic data structures are
flexible. They do not have a fixed number of element or
fixed size. So it is possible to add or remove elements easily.
Consider a linked list as an example. As discussed earlier,
elements of a linked list points to next element of the list.
Imagine that you want to remove element “C” of below
linked list. As you can see “B” is pointing at “C” and “C” is
pointing at element “D”. If we remove element “C”, element
“B” should point to element “D”, to keep the linked list
unbroken. So what we have to do is just changing the
pointers and assign element “C” with a NULL value, so that
garbage collator (or similar mechanism) will remove the
object and release the memory consumed by that object. An
example is shown below.
Addition of new items to an dynamic data
structure is also similar to the process of
removal. Imagine that we want to add an
element after element “B” and before element
“C”. What we have to do is simply adding the
new element to memory, changing pointer of B
to point to newly added element and setting
pointer of new element to point at element “C”.
So it is clear that, removal of an element from Static Data
Structure is not possible. It is possible to remove or null the
value of element, but it will not free the memory consumed
by the element. It is possible to create a new static data
structure and move the data from previous structure,
excluding the valued needed to be removed. However, it is a
resource consuming process, as it creates number of
instances of data structures to complete the process.
When it comes to dynamic data structures, removal is
efficient and easy to manage. In linked lists, it is all about
setting an object to null and changing some pointers. No new
objects will be created and resource consume is at minimum.
Insertion is also same, static structures have a fixed size, so
insertion of elements in not possible. The only way of inserting
elements to a static data structure is creating a new data
structure with required number of elements and copying the
previous values in to new structure. This is again a resource
consuming process. Think of a array containing 1000 elements
and you want to add a new element at the end. You’ll have to
create a new array with 1001 elements and move values from
previous array to new array making number of calls.
But when it comes to dynamic structure, addition of an
element is a simple process. In linked lists, it is just creation of an
object and changing two pointers. When compared with static
data structures, resource consume is at minimum and resources
are used effectively.
Advantages and Disadvantages
According to above discussion it is clear that dynamic data structures
share following characteristics.
Ability to efficiently add, remove or modify elements
Flexible size
Effective use of resources – because resources are allocated at the runtime,
as required.
Slower access to elements (when compared with static data structures)
Static data structures share following characteristics
Faster access to elements (when compared with dynamic data structures)
Add, remove or modify elements is not directly possible. If done, it is a
resource consuming process.
Fixed size.
Resources allocated at creation of data structure, even if elements are not
contain any value.
Abstraction and
Abstract Data Types
Abstraction
In computer science, abstraction is a technique for managing
complexity of computer systems. For example, a programmer
writing code that involves numerical operations may not be
interested in the way numbers are represented in the underlying
hardware (eg. whether they're 16 bit or 32 bit integers), and
where those details have been suppressed it can be said that they
were abstracted away, leaving simply numbers with which the
programmer can work.Another Example is when we enter Roll.
No. for knowing the result and we check our result direct.We
cannot know about the inner process.This process is due to
abstraction.Abstraction is simply the removal of unnecessary
detail.The idea is that to design of part of a complex system you
must identify what about that part other must know in order to
design their parts and what detail you can hide.The part other
must know is the abstraction.
It has two types.
1) Control Abstraction
2) Data Abstraction
Abstraction can to control or to data: Control
abstraction is the apply abstraction of actions while
data abstraction is that of data structures.
Control abstraction involves the use of
subprograms and related concepts control flows
Data abstraction allows handling data bits in
meaningful ways. For example, it is the basic
motivation behind datatype.
Abstract Data Type
An abstract data type is a logical explanation of data processing
with hidden implementation process.There are two parts of
ADTPublic or external part.
* The Conceptual picture(The users view that how the picture
look like,how the structure is organized).
* The conceptual operation(What’s the user can do the ADT).
2) The private or internal part.
* The representation(How the structure actually stored).
* The implementation of the operation(The actual code).
Examples..
Application Software,Browser,Skype and Games etc.
Figure shows a picture of what an abstract data type is and how it
operates. The user interacts with the interface, using the operations
that have been specified by the abstract data type. The abstract data
type is the shell that the user interacts with. The implementation is
hidden one level deeper. The user is not concerned with the details of
the implementation.
The implementation of an abstract data type, often referred to as
a data structure, will require that we provide a physical view of
the data using some collection of programming constructs and
primitive data types. As we discussed earlier, the separation of
these two perspectives will allow us to define the complex data
models for our problems without giving any indication as to the
details of how the model will actually be built. This provides an
implementation-independent view of the data. Since there will
usually be many different ways to implement an abstract data
type, this implementation independence allows the programmer
to switch the details of the implementation without changing the
way the user of the data interacts with it. The user can remain
focused on the problem-solving process.
Time and space
requirement of various
implementation of ADT’s
Data may be organized in many different ways. The logical or mathematical model
organization of data is called data structures . the choice of particular data structure
depend on the following considerations .
A. It must be able to represent the relationship of the data in the real world.
B. It must be simple enough so that it can be processed efficiently as and when
necessary.
The study of data structures includes:
A. Logical description of data structure.
B. Implementation of data structure.
Quantitative analysis of the data structure. This analysis includes determining the
amount of memory needed to store the data structure (also called as space complexity)
& the time required to process it. (also called as time complexity)
Time Complexity:
This measure is used to estimate the running time of algorithm in terms of size of
input data. For this purpose a popular notation called big ‘O’ notation is used.
Space Complexity :
This measure is used to define extra space consumed by the algorithm except
input data. This is also measured in terms of input size and big ’O’ notation is also popular in
this case as well.
To calculate time and space complexity we use following notations.
1. Big Oh notation :
The function f(n)=O(g(n)) ( read as f of n is big O of g of n if and only if their
exist positive constants c and m such that f(n)<=c*g(n) for all n,n>=m.
2. Omega notation:
The function f(n)=℩(g(n)) ( read as f of n is omega of g of n if and only if their
exist positive constants c and m such that f(n)>=c*g(n) for all n,n>=m.
3. Theta notation:
The function f(n)=Ɵ(g(n)) ( read as f of n is theta of g of n if and only if their exist
positive constants c and m such that c*g(n)<=f(n)<=c2*g(n) for all n,n>=m.

More Related Content

What's hot

Array data structure
Array data structureArray data structure
Array data structuremaamir farooq
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked ListNinad Mankar
 
Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stackvaibhav2910
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structureVardhil Patel
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHISowmya Jyothi
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++Vineeta Garg
 
Structures and Pointers
Structures and PointersStructures and Pointers
Structures and PointersPrabu U
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)Home
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfMaryJacob24
 
Linked list implementation of Queue
Linked list implementation of QueueLinked list implementation of Queue
Linked list implementation of QueueDr. Sindhia Lingaswamy
 
STACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data StructureSTACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data StructureYaksh Jethva
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2Self-Employed
 

What's hot (20)

Stack
StackStack
Stack
 
Array data structure
Array data structureArray data structure
Array data structure
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Introduction to stack
Introduction to stackIntroduction to stack
Introduction to stack
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
 
Queue
QueueQueue
Queue
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Data structure by Digvijay
Data structure by DigvijayData structure by Digvijay
Data structure by Digvijay
 
Linked List
Linked ListLinked List
Linked List
 
Stack project
Stack projectStack project
Stack project
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Structures and Pointers
Structures and PointersStructures and Pointers
Structures and Pointers
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Data Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdfData Structures & Recursion-Introduction.pdf
Data Structures & Recursion-Introduction.pdf
 
Linked list implementation of Queue
Linked list implementation of QueueLinked list implementation of Queue
Linked list implementation of Queue
 
STACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data StructureSTACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data Structure
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 

Viewers also liked

Abstract data types
Abstract data typesAbstract data types
Abstract data typesLuis Goldster
 
Database administrator performance appraisal
Database administrator performance appraisalDatabase administrator performance appraisal
Database administrator performance appraisaltaylorshannon964
 
11 abstract data types
11 abstract data types11 abstract data types
11 abstract data typesjigeno
 
Object model
Object modelObject model
Object modelHarry Potter
 
Applied Math 40S March 12, 2008
Applied Math 40S March 12, 2008Applied Math 40S March 12, 2008
Applied Math 40S March 12, 2008Darren Kuropatwa
 
GOOGLE ANALYTICS by Donny BU
GOOGLE ANALYTICS by Donny BUGOOGLE ANALYTICS by Donny BU
GOOGLE ANALYTICS by Donny BUAkademi Berbagi
 
Data What Type Of Data Do You Have V2.1
Data   What Type Of Data Do You Have V2.1Data   What Type Of Data Do You Have V2.1
Data What Type Of Data Do You Have V2.1TimKasse
 
Ewil survey results
Ewil survey resultsEwil survey results
Ewil survey resultsImede
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies glyvive
 
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II ajay pashankar
 
linked list
linked listlinked list
linked listAbbott
 
03 data abstraction
03 data abstraction03 data abstraction
03 data abstractionOpas Kaewtai
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1Kumar
 
Introduction to data structure by anil dutt
Introduction to data structure by anil duttIntroduction to data structure by anil dutt
Introduction to data structure by anil duttAnil Dutt
 

Viewers also liked (20)

Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Database administrator performance appraisal
Database administrator performance appraisalDatabase administrator performance appraisal
Database administrator performance appraisal
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Algo>Abstract data type
Algo>Abstract data typeAlgo>Abstract data type
Algo>Abstract data type
 
11 abstract data types
11 abstract data types11 abstract data types
11 abstract data types
 
Object model
Object modelObject model
Object model
 
Applied Math 40S March 12, 2008
Applied Math 40S March 12, 2008Applied Math 40S March 12, 2008
Applied Math 40S March 12, 2008
 
GOOGLE ANALYTICS by Donny BU
GOOGLE ANALYTICS by Donny BUGOOGLE ANALYTICS by Donny BU
GOOGLE ANALYTICS by Donny BU
 
Data What Type Of Data Do You Have V2.1
Data   What Type Of Data Do You Have V2.1Data   What Type Of Data Do You Have V2.1
Data What Type Of Data Do You Have V2.1
 
Ewil survey results
Ewil survey resultsEwil survey results
Ewil survey results
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies
 
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II Unit i  data structure FYCS MUMBAI UNIVERSITY SEM II
Unit i data structure FYCS MUMBAI UNIVERSITY SEM II
 
All Nationwide Internal Certs
All Nationwide Internal CertsAll Nationwide Internal Certs
All Nationwide Internal Certs
 
01 05 - introduction xml
01  05 - introduction xml01  05 - introduction xml
01 05 - introduction xml
 
linked list
linked listlinked list
linked list
 
L6 structure
L6 structureL6 structure
L6 structure
 
03 data abstraction
03 data abstraction03 data abstraction
03 data abstraction
 
Data structure lecture 1
Data structure lecture 1Data structure lecture 1
Data structure lecture 1
 
Introduction to data structure by anil dutt
Introduction to data structure by anil duttIntroduction to data structure by anil dutt
Introduction to data structure by anil dutt
 
04 type of data
04 type of data04 type of data
04 type of data
 

Similar to Data structure,abstraction,abstract data type,static and dynamic,time and space requirement of adt

Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Tutort Academy
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxmexiuro901
 
Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9dplunkett
 
Assignment 2
Assignment 2Assignment 2
Assignment 2FALLEE31188
 
Data_structure.pptx
Data_structure.pptxData_structure.pptx
Data_structure.pptxpriya415376
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptxselemonGamo
 
Data structures Lecture no. 2
Data structures Lecture no. 2Data structures Lecture no. 2
Data structures Lecture no. 2AzharIqbal710687
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxSaralaT3
 
Describes the concept of ADTS and illustrates the concept with three o.docx
Describes the concept of ADTS and illustrates the concept with three o.docxDescribes the concept of ADTS and illustrates the concept with three o.docx
Describes the concept of ADTS and illustrates the concept with three o.docxearleanp
 
Assignment
AssignmentAssignment
AssignmentFALLEE31188
 
Data Structure.pptx
Data Structure.pptxData Structure.pptx
Data Structure.pptxSajalFayyaz
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfarpitaeron555
 
Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures NotesRanjithkumar C
 
Data Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxData Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxUsriDevi1
 
stack 1.pdf
stack 1.pdfstack 1.pdf
stack 1.pdfhafsa40
 

Similar to Data structure,abstraction,abstract data type,static and dynamic,time and space requirement of adt (20)

Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
Data Structure
Data Structure Data Structure
Data Structure
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Data Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptxData Structures and algoithms Unit - 1.pptx
Data Structures and algoithms Unit - 1.pptx
 
Intro ds
Intro dsIntro ds
Intro ds
 
Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9
 
Assignment 2
Assignment 2Assignment 2
Assignment 2
 
Data_structure.pptx
Data_structure.pptxData_structure.pptx
Data_structure.pptx
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptx
 
Data structures Lecture no. 2
Data structures Lecture no. 2Data structures Lecture no. 2
Data structures Lecture no. 2
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Describes the concept of ADTS and illustrates the concept with three o.docx
Describes the concept of ADTS and illustrates the concept with three o.docxDescribes the concept of ADTS and illustrates the concept with three o.docx
Describes the concept of ADTS and illustrates the concept with three o.docx
 
Assignment
AssignmentAssignment
Assignment
 
Data Structure.pptx
Data Structure.pptxData Structure.pptx
Data Structure.pptx
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdf
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
 
Data Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptxData Structures & Algorithms Unit 1.pptx
Data Structures & Algorithms Unit 1.pptx
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
stack 1.pdf
stack 1.pdfstack 1.pdf
stack 1.pdf
 

More from Hassan Ahmed

Perception and Attention
Perception and AttentionPerception and Attention
Perception and AttentionHassan Ahmed
 
Hassan er diagram assignment
Hassan er diagram assignmentHassan er diagram assignment
Hassan er diagram assignmentHassan Ahmed
 
Normalization sparkling beelzebub
Normalization sparkling beelzebubNormalization sparkling beelzebub
Normalization sparkling beelzebubHassan Ahmed
 
Line integral,Strokes and Green Theorem
Line integral,Strokes and Green TheoremLine integral,Strokes and Green Theorem
Line integral,Strokes and Green TheoremHassan Ahmed
 
Parts of business letters and global communication
Parts of business letters and global communicationParts of business letters and global communication
Parts of business letters and global communicationHassan Ahmed
 
Role and advantage of computerized account system
Role and advantage of computerized account systemRole and advantage of computerized account system
Role and advantage of computerized account systemHassan Ahmed
 

More from Hassan Ahmed (6)

Perception and Attention
Perception and AttentionPerception and Attention
Perception and Attention
 
Hassan er diagram assignment
Hassan er diagram assignmentHassan er diagram assignment
Hassan er diagram assignment
 
Normalization sparkling beelzebub
Normalization sparkling beelzebubNormalization sparkling beelzebub
Normalization sparkling beelzebub
 
Line integral,Strokes and Green Theorem
Line integral,Strokes and Green TheoremLine integral,Strokes and Green Theorem
Line integral,Strokes and Green Theorem
 
Parts of business letters and global communication
Parts of business letters and global communicationParts of business letters and global communication
Parts of business letters and global communication
 
Role and advantage of computerized account system
Role and advantage of computerized account systemRole and advantage of computerized account system
Role and advantage of computerized account system
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar đŸ“± 9999965857 đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar đŸ“±  9999965857  đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar đŸ“±  9999965857  đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar đŸ“± 9999965857 đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 

Data structure,abstraction,abstract data type,static and dynamic,time and space requirement of adt

  • 1.
  • 2. Sparkling Beelzebub Group Members : 1)Muhammmad Mazhar Mustafa Shahid 2)Hassan Ahmed 3)Imran Farooq Mughal 4)Hafiz Salman Majeed 5)Hafiz Muhammad Hamza
  • 3. Submitted To Respected Mam Sobia Sarwar Topics: 1.Basic data structures 2.Static and dynamic data structures 3.Abstraction and ADT’s 4.Time and space requirements of various implementation of ADT’s
  • 5. Basic data structure In Computer science daIn ta structure is a particular way of storing and organizing data in computer so it can be efficiently
. *Objectives
.. *We use this · To understand the abstract data types stack, queue, deque, and list. To understand the performance of the implementations of basic linear data structures. · To understand prefix, infix, and postfix expression formats. · To use stacks to evaluate postfix expressions. · To use stacks to convert expressions from infix to postfix. · To use queues for basic timing simulations. *and many more
.
  • 6. b) LINEAR DATA STRUCTURES
. THAT IS THE SIMPLIST FORM OF DATA STRUCTURES
.. Stacks, queues, deques, and lists are examples of data collections whose items are ordered depending on how they are added or removed. Once an item is added, it stays in that position relative to the other elements that came before and came after it. SUCH SORT OF Collections are often referred as linear data STRUCTURES
. Linear structures can be thought of as having two ends. Sometimes these ends are referred to as the “left” and the “right” or in some cases the “front” and the “rear.” You could also call them the “top” and the “bottom.” The names given to the ends are not significant. What distinguishes one linear structure from another is the way in which items are added and removed. in particular the location where these additions and removals occur. For example, a structure might allow new items to be added at only one end. Some structures might allow items to be removed from either end.
  • 7. A stack (sometimes called a “push-down stack”) is an ordered collection of items where the addition of new items and the removal of existing items always takes place at the same end. This end is commonly referred to as the “top.” The end opposite the top is known as the “base.” The base of the stack is significant since items stored in the stack that are closer to the base represent those that have been in the stack the longest. The most recently added item is the one that is in position to be removed first. This ordering principle is sometimes called LIFO, last-in first-out. It provides an ordering based on length of time in the collection. Newer items are near the top, while older items are near the base. Many examples of stacks occur in everyday situations. Almost any cafeteria has a stack of trays or plates where you take the one at the top, uncovering a new tray or plate for the next customer in line. Imagine a stack of books on a desk
  • 8. The only book whose cover is visible is the one on top. To access others in the stack, we need to remove the ones that are sitting on top of them. Considering this reversal property, you can perhaps think of examples of stacks that occur as you use your computer. For example, every web browser has a Back button. As you navigate from web page to web page, those pages are placed on a stack (actually it is the URLs that are going on the stack). The current page that you are viewing is on the top and the first page you looked at is at the base. If you click on the Back button, you begin to move in reverse order through the pages.
  • 9. As an element enters the queue it starts at the rear and makes its way toward the front, waiting until that time when it is the next element to be removed. A queue is an ordered collection of items where the addition of new items happens at one end, called the “rear,” and the removal of existing items occurs at the other end, commonly called the “front.” The most recently added item in the queue must wait at the end of the collection UNTILL a next elements comes in. This ordering principle is sometimes called FIFO, first-in first-out Example printing process
  • 10. What Is a Deque? A deque, also known as a double-ended queue, is an ordered collection of items similar to the queue. It has two ends, a front and a rear, and the items remain positioned in the collection. What makes a deque different is the unrestrictive nature of adding and removing items. New items can be added at either the front or the rear. Likewise, existing items can be removed from either end
 It is important to note that even though the deque can assume many of the characteristics of stacks and queues, it does not require the LIFO and FIFO orderings that are enforced by those data structures. It is up to you to make consistent use of the addition and removal operations.
  • 11. What is Lists? The list is a powerful, yet simple, collection OF mechanism that provides the programmer a wide variety of operations. However, not all programming languages include a list collection. A list is a collection of items where each item holds a relative position with respect to the others.WE CAN SAY THAT IT’S A SYMITRICAL ARRANGMENT OF ITEMS. we will refer to this type of list as an unordered list. We can consider the list as having a first item, a second item, a third item, and so on. ). For simplicity we will assume that lists cannot contain duplicate items. For example, the collection of integers 54, 26, 93, 17, 77, and 31 might represent a simple unordered list of exam scores. Note that we have written them as comma-delimited values, a common way of showing the list structure. [54,26,93,17,77,31].
  • 13. Data Structure is a way of storing and organizing data, effectively. There are two major categories of Data Structures called ˜’Static Structures’ and ‘˜Dynamic Structures’.
  • 14. Static Data Structures As same as the word static suggests, static data structures are designed to store static “set of data”. However, static “set of data”, doesn’t mean that we can not change the assigned values of elements. It is the memory size allocated to “data”, which is static. So that, it is possible to change content of a static structure but without increasing the memory space allocated to it.
  • 15. Dynamic Data Structures Dynamic data structures are designed to facilitate change of data structures in the runtime. It is possible to change the assigned values of elements, as it was with static structures. Also, in dynamic structures the initially allocated memory size is not a problem. It is possible to add new elements, remove existing elements or do any kind of operation on data set without considering about the memory space allocated initially.
  • 16. Difference Between Static and Dynamic Data Structure Static data structure is given a fixed area of memory which it can operate within. It is not possible to expand this fixed size in the run time. So that, locations of each element is fixed and known by the program. Dynamic data structure also has an area where it can operate. However, this size of the area is flexible, not fixed as it was with static data structures. It is possible to increase or decrease the area as required, by adding or removing elements from data structure.
  • 17. From here onwards an example of a static array and a dynamic linked list, will be considered to discuss differences.
  • 18. Insertions and Removals As discussed earlier, static structure has fixed sizes. It is possible to remove the value of an element, but the element is still there in the structure. Only difference is that element doesn’t contain any data. Such removal is not going to free the memory occupied by the element and can be considered as a waste of resources.
  • 19. What about adding new elements to a static structure? As you already know it is not possible because static data structure has a fixed size. In order to add new element, we should create a new static structure with number of elements required and move the data from existing structure to new structure and assign additional elements with required values.
  • 20. As discussed earlier, dynamic data structures are flexible. They do not have a fixed number of element or fixed size. So it is possible to add or remove elements easily. Consider a linked list as an example. As discussed earlier, elements of a linked list points to next element of the list. Imagine that you want to remove element “C” of below linked list. As you can see “B” is pointing at “C” and “C” is pointing at element “D”. If we remove element “C”, element “B” should point to element “D”, to keep the linked list unbroken. So what we have to do is just changing the pointers and assign element “C” with a NULL value, so that garbage collator (or similar mechanism) will remove the object and release the memory consumed by that object. An example is shown below.
  • 21.
  • 22. Addition of new items to an dynamic data structure is also similar to the process of removal. Imagine that we want to add an element after element “B” and before element “C”. What we have to do is simply adding the new element to memory, changing pointer of B to point to newly added element and setting pointer of new element to point at element “C”.
  • 23.
  • 24. So it is clear that, removal of an element from Static Data Structure is not possible. It is possible to remove or null the value of element, but it will not free the memory consumed by the element. It is possible to create a new static data structure and move the data from previous structure, excluding the valued needed to be removed. However, it is a resource consuming process, as it creates number of instances of data structures to complete the process. When it comes to dynamic data structures, removal is efficient and easy to manage. In linked lists, it is all about setting an object to null and changing some pointers. No new objects will be created and resource consume is at minimum.
  • 25. Insertion is also same, static structures have a fixed size, so insertion of elements in not possible. The only way of inserting elements to a static data structure is creating a new data structure with required number of elements and copying the previous values in to new structure. This is again a resource consuming process. Think of a array containing 1000 elements and you want to add a new element at the end. You’ll have to create a new array with 1001 elements and move values from previous array to new array making number of calls. But when it comes to dynamic structure, addition of an element is a simple process. In linked lists, it is just creation of an object and changing two pointers. When compared with static data structures, resource consume is at minimum and resources are used effectively.
  • 26. Advantages and Disadvantages According to above discussion it is clear that dynamic data structures share following characteristics. Ability to efficiently add, remove or modify elements Flexible size Effective use of resources – because resources are allocated at the runtime, as required. Slower access to elements (when compared with static data structures) Static data structures share following characteristics Faster access to elements (when compared with dynamic data structures) Add, remove or modify elements is not directly possible. If done, it is a resource consuming process. Fixed size. Resources allocated at creation of data structure, even if elements are not contain any value.
  • 28. Abstraction In computer science, abstraction is a technique for managing complexity of computer systems. For example, a programmer writing code that involves numerical operations may not be interested in the way numbers are represented in the underlying hardware (eg. whether they're 16 bit or 32 bit integers), and where those details have been suppressed it can be said that they were abstracted away, leaving simply numbers with which the programmer can work.Another Example is when we enter Roll. No. for knowing the result and we check our result direct.We cannot know about the inner process.This process is due to abstraction.Abstraction is simply the removal of unnecessary detail.The idea is that to design of part of a complex system you must identify what about that part other must know in order to design their parts and what detail you can hide.The part other must know is the abstraction.
  • 29. It has two types. 1) Control Abstraction 2) Data Abstraction Abstraction can to control or to data: Control abstraction is the apply abstraction of actions while data abstraction is that of data structures. Control abstraction involves the use of subprograms and related concepts control flows Data abstraction allows handling data bits in meaningful ways. For example, it is the basic motivation behind datatype.
  • 30. Abstract Data Type An abstract data type is a logical explanation of data processing with hidden implementation process.There are two parts of ADTPublic or external part. * The Conceptual picture(The users view that how the picture look like,how the structure is organized). * The conceptual operation(What’s the user can do the ADT). 2) The private or internal part. * The representation(How the structure actually stored). * The implementation of the operation(The actual code). Examples.. Application Software,Browser,Skype and Games etc.
  • 31. Figure shows a picture of what an abstract data type is and how it operates. The user interacts with the interface, using the operations that have been specified by the abstract data type. The abstract data type is the shell that the user interacts with. The implementation is hidden one level deeper. The user is not concerned with the details of the implementation.
  • 32. The implementation of an abstract data type, often referred to as a data structure, will require that we provide a physical view of the data using some collection of programming constructs and primitive data types. As we discussed earlier, the separation of these two perspectives will allow us to define the complex data models for our problems without giving any indication as to the details of how the model will actually be built. This provides an implementation-independent view of the data. Since there will usually be many different ways to implement an abstract data type, this implementation independence allows the programmer to switch the details of the implementation without changing the way the user of the data interacts with it. The user can remain focused on the problem-solving process.
  • 33. Time and space requirement of various implementation of ADT’s
  • 34. Data may be organized in many different ways. The logical or mathematical model organization of data is called data structures . the choice of particular data structure depend on the following considerations . A. It must be able to represent the relationship of the data in the real world. B. It must be simple enough so that it can be processed efficiently as and when necessary. The study of data structures includes: A. Logical description of data structure. B. Implementation of data structure. Quantitative analysis of the data structure. This analysis includes determining the amount of memory needed to store the data structure (also called as space complexity) & the time required to process it. (also called as time complexity)
  • 35. Time Complexity: This measure is used to estimate the running time of algorithm in terms of size of input data. For this purpose a popular notation called big ‘O’ notation is used. Space Complexity : This measure is used to define extra space consumed by the algorithm except input data. This is also measured in terms of input size and big ’O’ notation is also popular in this case as well. To calculate time and space complexity we use following notations. 1. Big Oh notation : The function f(n)=O(g(n)) ( read as f of n is big O of g of n if and only if their exist positive constants c and m such that f(n)<=c*g(n) for all n,n>=m. 2. Omega notation: The function f(n)=℩(g(n)) ( read as f of n is omega of g of n if and only if their exist positive constants c and m such that f(n)>=c*g(n) for all n,n>=m. 3. Theta notation: The function f(n)=Ɵ(g(n)) ( read as f of n is theta of g of n if and only if their exist positive constants c and m such that c*g(n)<=f(n)<=c2*g(n) for all n,n>=m.