SlideShare a Scribd company logo
1 of 18
DATA
STRUCTURES
Objectives
At the end of the lesson, the student should be able
to:
 Explain the process of problem solving
 Define data type, abstract data type and data
structure
 Identify the properties of an algorithm
 Differentiate the two addressing methods –
computed addressing and link addressing
 Use the basic mathematical functions to
analyze algorithms
 Measure complexity of algorithms by
expressing the efficiency in terms of time
complexity and big-O notation
Problem Solving Process
 Programming – a problem-solving process which could
be viewed in terms of the following domains:
 Problem domain
▪ input or the raw data to process
▪ output or the processed data
▪ E.g.: sorting of a set of numbers,
▪ raw data: set of numbers in the original order
▪ Processed data: sorted numbers
 Machine domain
▪ storage medium - consists of serially arranged bits that are
addressable as a unit
▪ processing unit - allow us to perform basic operations(i.e.
arithmetic, comparisons)
 Solution domain - links the problem and machine domains
Problem Solving Process
Problem Domain
Problem Solving Process
Machine Domain
Problem Solving Process
Solution Domain
Problem Solving Process
 Two related tasks at the solution domain
 Structuring of higher level data representations
 Synthesis of algorithms
 NOTE: Data Structures and Algorithms are the
building blocks of computer programs
Data Type, Abstract Data Type and
Data Structure
 Data type - kind of data that variables can
assume in a programming language and for
which operations are automatically provided
 Abstract Data Type (ADT) - mathematical
model with defined operations. In Java, an ADT
can be expressed with an interface
Data Type, Abstract Data Type and
Data Structure
public interface Stack{
public int size(); /* returns the size of the stack */
public boolean isEmpty(); /* checks if empty */
public Object top() throws StackException;
public Object pop() throws StackException;
public void push(Object item) throws StackException;
}
 Data structure – the implementation of ADT in
terms of the data types or other data
structures. In Java, a data structure can be
expressed with a class
Algorithm
 Finite set of instructions which, if followed, will
accomplish a task
 Finiteness - an algorithm must terminate after a finite
number of steps
 Definiteness - ensured if every step of an algorithm is
precisely defined
 Input - domain of the algorithm which could be zero or
more quantities
 Output - set of one or more resulting quantities; also
called the range of the algorithm
 Effectiveness - ensured if all the operations in the
algorithm are sufficiently basic that they can, in
principle, be done exactly and in finite time by a person
using paper and pen
Addressing Methods
 Computed Addressing Method - used to access the elements
of a structure in pre-allocated space
int x[10][20];
a = x[4][3];
 Link Addressing Method – used to manipulate dynamic
structures where the size and shape are not known
beforehand or changes at runtime
class Node{
Object info;
Node link;
Node() { }
Node (Object o, Node l){
info = o;
link = l;
}
}
Addressing Methods
 Memory pool or avail list - source of the nodes
from which linked structures are built
class AvailList {
Node head;
AvailList(){
head = null;
}
AvailList(Node n){
head = n;
}
}
Addressing Methods
 Two basic procedures that manipulate the avail list are getNode
and retNode, which requests for a node and returns a node
respectively.
Node getNode(){
Node a;
if ( head == null) {
return null; /* avail list is empty */
} else {
a = head.link; /* assign node to return to a */
head = head.link.link;
return a;
}
}
void retNode(Node n){
n.link = head.link; /* adds the new node at the start of the avail list */
head.link = n;
}
Mathematical Functions
 Floor of x ( ⎣ x ⎦ ) - greatest integer less than or
equal to x, x is any real number
e.g.: ⎣ 3.14 ⎦ = 3
⎣ 1/2 ⎦ = 0
⎣ -1/2 ⎦ = -1
Mathematical Functions
 Ceiling of x ( ⎡ x ⎤ ) - smallest integer greater
than or equal to x, where x is any real number
e.g.: ⎡ 3.14 ⎤ = 4
⎡ 1/2 ⎤ = 1
⎡ -1/2 ⎤ = 0
Mathematical Functions
 Modulo – remainder operator
e.g.: 10 mod 3 = 1
24 mod 8 = 0
-5 mod 7 = -5
Mathematical Functions
 Identities
 ⎡ x ⎤ = ⎣ x ⎦ if and only if x is an integer
 ⎡ x ⎤ = ⎣ x ⎦ + 1 if and only if x is not an integer
 ⎣ - x ⎦ = - ⎡ x ⎤
 ⎣ x ⎦ + ⎣ y ⎦ <= ⎣ x + y⎦
 x = ⎣ x ⎦ + x mod 1
 z ( x mod y ) = zx mod zy
Complexity of Algorithms
 Algorithm Efficiency
 Space utilization - amount of memory required to
store the data
 Time efficiency - amount of time required to
process the data
▪ Execution time - amount of time spent in executing
instructions of a given algorithm. Notation: T(n). Several
factors that affect the execution time include:
▪ input size
▪ Instruction type
▪ machine speed
▪ quality of source code of the algorithm implementation
▪ quality of the machine code generated from the source code
by the compiler

More Related Content

What's hot

19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
ashishtinku
 

What's hot (20)

17. Trees and Tree Like Structures
17. Trees and Tree Like Structures17. Trees and Tree Like Structures
17. Trees and Tree Like Structures
 
Lec4
Lec4Lec4
Lec4
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
Week7
Week7Week7
Week7
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
 
Lec16
Lec16Lec16
Lec16
 
18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set
 
Arrays
ArraysArrays
Arrays
 
Chapter 9 ds
Chapter 9 dsChapter 9 ds
Chapter 9 ds
 
Lec4
Lec4Lec4
Lec4
 
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
 
Chapter 4 - Classes in Java
Chapter 4 - Classes in JavaChapter 4 - Classes in Java
Chapter 4 - Classes in Java
 
Chapter 3 Arrays in Java
Chapter 3 Arrays in JavaChapter 3 Arrays in Java
Chapter 3 Arrays in Java
 
algorithm unit 1
algorithm unit 1algorithm unit 1
algorithm unit 1
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
 
Lec5
Lec5Lec5
Lec5
 
Lec1
Lec1Lec1
Lec1
 
19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
algorithm Unit 2
algorithm Unit 2 algorithm Unit 2
algorithm Unit 2
 

Viewers also liked

Java data structures for principled programmer
Java data structures for principled programmerJava data structures for principled programmer
Java data structures for principled programmer
spnr15z
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpoint
ravi tyagi
 
Preview java j2_ee_book
Preview java j2_ee_bookPreview java j2_ee_book
Preview java j2_ee_book
Subhadip Pal
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
saleForce
 
Html, xml and java script
Html, xml and java scriptHtml, xml and java script
Html, xml and java script
Rajeev Uppala
 
L7 decision tree & table
L7 decision tree & tableL7 decision tree & table
L7 decision tree & table
Neha Gupta
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 

Viewers also liked (20)

Core java interview questions
Core java interview questionsCore java interview questions
Core java interview questions
 
Java data structures for principled programmer
Java data structures for principled programmerJava data structures for principled programmer
Java data structures for principled programmer
 
2-4 tree
2-4 tree2-4 tree
2-4 tree
 
2 3 tree
2 3 tree2 3 tree
2 3 tree
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpoint
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Preview java j2_ee_book
Preview java j2_ee_bookPreview java j2_ee_book
Preview java j2_ee_book
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
PIN Specification of 8086 Microprocessor
PIN Specification of 8086 MicroprocessorPIN Specification of 8086 Microprocessor
PIN Specification of 8086 Microprocessor
 
Java object oriented programming - OOPS
Java object oriented programming - OOPSJava object oriented programming - OOPS
Java object oriented programming - OOPS
 
Html, xml and java script
Html, xml and java scriptHtml, xml and java script
Html, xml and java script
 
L7 decision tree & table
L7 decision tree & tableL7 decision tree & table
L7 decision tree & table
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram description
 
Workday hcm interview questions
Workday hcm interview questionsWorkday hcm interview questions
Workday hcm interview questions
 
Oracle Fusion v/s Workday
Oracle Fusion v/s WorkdayOracle Fusion v/s Workday
Oracle Fusion v/s Workday
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 
Java Day-2
Java Day-2Java Day-2
Java Day-2
 
Enum Report
Enum ReportEnum Report
Enum Report
 
Java Day-7
Java Day-7Java Day-7
Java Day-7
 
Memory Segmentation of 8086
Memory Segmentation of 8086Memory Segmentation of 8086
Memory Segmentation of 8086
 

Similar to Advanced data structures slide 1 2

Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
James Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
Fraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
Tony Nguyen
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
KarthikVijay59
 

Similar to Advanced data structures slide 1 2 (20)

Introduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptxIntroduction to data structures and complexity.pptx
Introduction to data structures and complexity.pptx
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
Matlab Functions
Matlab FunctionsMatlab Functions
Matlab Functions
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
 
8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx
 

More from jomerson remorosa (6)

XML DTD Validate
XML DTD ValidateXML DTD Validate
XML DTD Validate
 
ORACLE: Normalization student
ORACLE: Normalization student ORACLE: Normalization student
ORACLE: Normalization student
 
ORACLE: Database management system student
ORACLE: Database management system studentORACLE: Database management system student
ORACLE: Database management system student
 
Cisco network 1 1
Cisco network 1 1Cisco network 1 1
Cisco network 1 1
 
Logic design and switching theory
Logic design and switching theoryLogic design and switching theory
Logic design and switching theory
 
Advanced data structures slide 2 2+
Advanced data structures slide 2 2+Advanced data structures slide 2 2+
Advanced data structures slide 2 2+
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Advanced data structures slide 1 2

  • 2. Objectives At the end of the lesson, the student should be able to:  Explain the process of problem solving  Define data type, abstract data type and data structure  Identify the properties of an algorithm  Differentiate the two addressing methods – computed addressing and link addressing  Use the basic mathematical functions to analyze algorithms  Measure complexity of algorithms by expressing the efficiency in terms of time complexity and big-O notation
  • 3. Problem Solving Process  Programming – a problem-solving process which could be viewed in terms of the following domains:  Problem domain ▪ input or the raw data to process ▪ output or the processed data ▪ E.g.: sorting of a set of numbers, ▪ raw data: set of numbers in the original order ▪ Processed data: sorted numbers  Machine domain ▪ storage medium - consists of serially arranged bits that are addressable as a unit ▪ processing unit - allow us to perform basic operations(i.e. arithmetic, comparisons)  Solution domain - links the problem and machine domains
  • 7. Problem Solving Process  Two related tasks at the solution domain  Structuring of higher level data representations  Synthesis of algorithms  NOTE: Data Structures and Algorithms are the building blocks of computer programs
  • 8. Data Type, Abstract Data Type and Data Structure  Data type - kind of data that variables can assume in a programming language and for which operations are automatically provided  Abstract Data Type (ADT) - mathematical model with defined operations. In Java, an ADT can be expressed with an interface
  • 9. Data Type, Abstract Data Type and Data Structure public interface Stack{ public int size(); /* returns the size of the stack */ public boolean isEmpty(); /* checks if empty */ public Object top() throws StackException; public Object pop() throws StackException; public void push(Object item) throws StackException; }  Data structure – the implementation of ADT in terms of the data types or other data structures. In Java, a data structure can be expressed with a class
  • 10. Algorithm  Finite set of instructions which, if followed, will accomplish a task  Finiteness - an algorithm must terminate after a finite number of steps  Definiteness - ensured if every step of an algorithm is precisely defined  Input - domain of the algorithm which could be zero or more quantities  Output - set of one or more resulting quantities; also called the range of the algorithm  Effectiveness - ensured if all the operations in the algorithm are sufficiently basic that they can, in principle, be done exactly and in finite time by a person using paper and pen
  • 11. Addressing Methods  Computed Addressing Method - used to access the elements of a structure in pre-allocated space int x[10][20]; a = x[4][3];  Link Addressing Method – used to manipulate dynamic structures where the size and shape are not known beforehand or changes at runtime class Node{ Object info; Node link; Node() { } Node (Object o, Node l){ info = o; link = l; } }
  • 12. Addressing Methods  Memory pool or avail list - source of the nodes from which linked structures are built class AvailList { Node head; AvailList(){ head = null; } AvailList(Node n){ head = n; } }
  • 13. Addressing Methods  Two basic procedures that manipulate the avail list are getNode and retNode, which requests for a node and returns a node respectively. Node getNode(){ Node a; if ( head == null) { return null; /* avail list is empty */ } else { a = head.link; /* assign node to return to a */ head = head.link.link; return a; } } void retNode(Node n){ n.link = head.link; /* adds the new node at the start of the avail list */ head.link = n; }
  • 14. Mathematical Functions  Floor of x ( ⎣ x ⎦ ) - greatest integer less than or equal to x, x is any real number e.g.: ⎣ 3.14 ⎦ = 3 ⎣ 1/2 ⎦ = 0 ⎣ -1/2 ⎦ = -1
  • 15. Mathematical Functions  Ceiling of x ( ⎡ x ⎤ ) - smallest integer greater than or equal to x, where x is any real number e.g.: ⎡ 3.14 ⎤ = 4 ⎡ 1/2 ⎤ = 1 ⎡ -1/2 ⎤ = 0
  • 16. Mathematical Functions  Modulo – remainder operator e.g.: 10 mod 3 = 1 24 mod 8 = 0 -5 mod 7 = -5
  • 17. Mathematical Functions  Identities  ⎡ x ⎤ = ⎣ x ⎦ if and only if x is an integer  ⎡ x ⎤ = ⎣ x ⎦ + 1 if and only if x is not an integer  ⎣ - x ⎦ = - ⎡ x ⎤  ⎣ x ⎦ + ⎣ y ⎦ <= ⎣ x + y⎦  x = ⎣ x ⎦ + x mod 1  z ( x mod y ) = zx mod zy
  • 18. Complexity of Algorithms  Algorithm Efficiency  Space utilization - amount of memory required to store the data  Time efficiency - amount of time required to process the data ▪ Execution time - amount of time spent in executing instructions of a given algorithm. Notation: T(n). Several factors that affect the execution time include: ▪ input size ▪ Instruction type ▪ machine speed ▪ quality of source code of the algorithm implementation ▪ quality of the machine code generated from the source code by the compiler