SlideShare a Scribd company logo
1 of 30
CSCI 4140 Advanced Algorithms
Dr. Zahid Khan
CUSSA Instructor
Outlines
 About the course
Objectives
Contents
Course Materials
Exams & Evaluations
 Introduction to Data Structure
 Basic Data Structures
 Introduction to Algorithm
 Summary
2
About the course
 Analyze the asymptotic performance of algorithms.
 Write rigorous correctness proofs for algorithms.
 Demonstrate a familiarity with major algorithms and data structures.
 Apply important algorithmic design paradigms and methods of analysis.
 Synthesize efficient algorithms in common engineering design
situations.
3
About the course
4
 See the syllabus
◦ Uploaded to the course portal
About the course
Introduction to Algorithms
3rd edition, Thomas H Cormen Charles E,
Leiserson Ronald L Rivest Clifford Stein,
MIT press.
• Lecture slides and programing examples
will also be shared after very class
5
About the course
6
Assessments Quantity Percentage
Quizzes 5 20%
Projects 2 20%
Mid-Terms 2 30%
Final Exam 1 30%
About the course
 Regular Lectures:
Sunday, Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday: 09:00 AM to 10:50AM
 Consultation Hours:
You can send me an email at any time.
7
Introduction
 Definition
 Basic Data Structures
 Choosing a Data Structure
◦ Examples
 Data Structure operations
8
Definition
◦ A data structure is a way to store and organize data
in order to facilitate access and modifications
◦ No single data structure works well for all purposes,
and so it is important to know the strengths and
limitations of several of them
9
Basic Data Structures
10
Basic Data Structures
Linear Data Structures Non-Linear Data Structures
Arrays LinkedLists Stacks Queues Trees Graphs Hash Tables
What data structure to use?
11
array
Linked list
tree
queue
stack
Choosing a Data Structures
 The choice of particular data model
depends on two consideration:
◦ It must be rich enough in structure to mirror the actual
relationships of data in the real world
◦ The structure should be simple enough that one can
effectively process the data when necessary
12
Basic data structures
 Linear structures
◦ Array: Fixed-size
◦ Linked-list: Variable-size
◦ Stack: Add to top and remove from top
◦ Queue: Add to back and remove from front
◦ Priority queue: Add anywhere, remove having highest priority
 Hash tables: Unordered lists which use a ‘hash function’ to insert
and search
 Tree: A branching structure with no loops
 Graph: A Graph consist of a set of vertices V and a set of edges E
13
Arrays
 Linear array : A list of a
finite number n of
similar data elements
referenced respectively
by a set of n
consecutive numbers
 Also known as one
dimensional arrays
14
STUDENT
Usman Saleem
Usama Arshad
Nasir Fida
Tayyab Ahmad
Abdullah
Musa Ahmad
1
2
3
4
5
6
Arrays
 Multidimensional arrays
◦ Each elements is referenced
by two subscripts
◦ For example, weekly sales
record of a chain of 28
stores, each having 4 depts
15
Linked List
 Suppose a firm maintains
a file, as shown here
 This file could be stored
in the computer by two
columns of nine names
 However, there is
redundant information in
such a scheme,
especially if we have
hundreds of names 16
Customer Salesperson
Adams Smith
Brown Ray
Clark Jones
Evans Smith
Farmer Jones
Drew Jones
Geller Ray
Hill Smith
Infeld Ray
1
2
3
4
5
6
7
8
9
Alternate representation
17
Salesperson
Jones
Ray
Smith
Customer Pointer
Adams 3
Brown 2
Clark 1
Evans 2
Farmer 3
Farmer 1
Geller 2
Hill 3
Infeld 2
1
2
3
4
5
6
7
8
9
3
2
1
An integer used as a pointer
requires less space than a name:
hence this representation saves
space.
Alternate representation
(cont.)
 Now suppose the firm wants the list of
customers for a given salesperson
◦ Using the data representation in last slide,
search is to be carried out through the
entire file ( not a good solution)
 Any Solution?
◦ Arrows to point the other way
18
Another representation
19
Salesperson Pointer
Jones 3, 6
Ray 2, 4, 7, 9
Smith 1, 5, 8
 Can you think of any disadvantage associated with this scheme ?
◦ Set of pointers will change as customers are added and deleted,
because each salesperson may have many pointers
Still another representation
20
Customer Pointer
Adams 5
Brown 4
Clark 6
Evans 7
Farmer 8
Farmer 0
Geller 9
Hill 0
Infeld 0
1
2
3
4
5
6
7
8
9
Salesperson Pointers
Jones 3
Ray 2
Smith 1 3
2
1
Now we can easily insert and
delete customers
This
representation
is an example
of linked list
Hierarchical relationship
 Data frequently contain a hierarchical relationship between
various elements
 Data structure used to reflect such kind of relationship is called a
rooted tree graph or simply a tree.
 For example, an employee personal record may contain the
following data items:
◦ Social security number,
◦ Name,
◦ Address,
◦ Age,
◦ Salary,
◦ Dependents
 However Name is composed of subitems,
◦ Last,
◦ First
◦ MI (middle initial)
 Similarly we have address item
21
Trees
22
22
City Province Country
Area
Street
Address
Name
Last First MI
CNIC # Age Salary Dependent
Employee
Example
 Consider the following algebraic
expression
◦ (2x+y)(a-7b)3
◦ How can we represent such a data
structure?
23
Tree
24
*
+
y
*
x
2
^
3
-
a *
7 b
(2x+y)(a-7b)3
Other data structures
 Stack (LIFO)
◦ E.g., stack of dishes
 Queue (FIFO)
◦ E.g., line of people waiting at bus stand
 Graph
◦ Sometimes relationship between pairs of
data elements is not hierarchical.
25
Stacks
26
2132
123
123
123
123
123
123
546
45
543
3
3
2544
IN
OUT
Queue
27
2132
123
123
123
123
123
3
3
2544
33
IN
OUT
The Need for Data Structures
 Goal: to organize data
 Criteria: to facilitate efficient
◦ storage of data
◦ retrieval of data
◦ manipulation of data
 Design Issue:
◦ select and design appropriate data types.
(This is the real essence of OOP.)
28
After Class Dicussion (Self Test)
 Differentiate static and dynamic data structure.
 Why Data structure is necessory?
 What are the limitations of algorithms?
 How the efficiency of an algorithm can be measured ?
29
Q/A
30

More Related Content

Similar to CSCI 4140-AA Pre-Req.ppt

EE-232-LEC-01 Data_structures.pptx
EE-232-LEC-01 Data_structures.pptxEE-232-LEC-01 Data_structures.pptx
EE-232-LEC-01 Data_structures.pptxiamultapromax
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional ModelingSunita Sahu
 
2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_uploadProf. Wim Van Criekinge
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- FundamentalsMohammed El Hedhly
 
data structure
data structuredata structure
data structurehashim102
 
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfData_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfNho Vĩnh
 
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptx
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptxfINAL Lesson_5_Data_Manipulation_using_R_v1.pptx
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptxdataKarthik
 
Case Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxCase Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxcowinhelen
 
Case Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxCase Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxjasoninnes20
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesDataminingTools Inc
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributesweka Content
 
Dbms Lec Uog 02
Dbms Lec Uog 02Dbms Lec Uog 02
Dbms Lec Uog 02smelltulip
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdfgm6523
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxmueedmughal88
 

Similar to CSCI 4140-AA Pre-Req.ppt (20)

EE-232-LEC-01 Data_structures.pptx
EE-232-LEC-01 Data_structures.pptxEE-232-LEC-01 Data_structures.pptx
EE-232-LEC-01 Data_structures.pptx
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 
data structure
data structuredata structure
data structure
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdfData_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
Data_Structure_and_Algorithms_Using_C++ _ Nho Vĩnh Share.pdf
 
DISE - Database Concepts
DISE - Database ConceptsDISE - Database Concepts
DISE - Database Concepts
 
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptx
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptxfINAL Lesson_5_Data_Manipulation_using_R_v1.pptx
fINAL Lesson_5_Data_Manipulation_using_R_v1.pptx
 
Case Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxCase Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docx
 
Case Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docxCase Analysis Format 1. Title of Case a. Author of t.docx
Case Analysis Format 1. Title of Case a. Author of t.docx
 
WEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And AttributesWEKA: Data Mining Input Concepts Instances And Attributes
WEKA: Data Mining Input Concepts Instances And Attributes
 
WEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And AttributesWEKA:Data Mining Input Concepts Instances And Attributes
WEKA:Data Mining Input Concepts Instances And Attributes
 
Dbms Lec Uog 02
Dbms Lec Uog 02Dbms Lec Uog 02
Dbms Lec Uog 02
 
RDBMS Model
RDBMS ModelRDBMS Model
RDBMS Model
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
 
Databases By ZAK
Databases By ZAKDatabases By ZAK
Databases By ZAK
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Topics-Ch4Ch5.ppt
Topics-Ch4Ch5.pptTopics-Ch4Ch5.ppt
Topics-Ch4Ch5.ppt
 
Lecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptxLecture_1_Introduction to Data Structures and Algorithm.pptx
Lecture_1_Introduction to Data Structures and Algorithm.pptx
 

Recently uploaded

办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一F La
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 

Recently uploaded (20)

办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 

CSCI 4140-AA Pre-Req.ppt

  • 1. CSCI 4140 Advanced Algorithms Dr. Zahid Khan CUSSA Instructor
  • 2. Outlines  About the course Objectives Contents Course Materials Exams & Evaluations  Introduction to Data Structure  Basic Data Structures  Introduction to Algorithm  Summary 2
  • 3. About the course  Analyze the asymptotic performance of algorithms.  Write rigorous correctness proofs for algorithms.  Demonstrate a familiarity with major algorithms and data structures.  Apply important algorithmic design paradigms and methods of analysis.  Synthesize efficient algorithms in common engineering design situations. 3
  • 4. About the course 4  See the syllabus ◦ Uploaded to the course portal
  • 5. About the course Introduction to Algorithms 3rd edition, Thomas H Cormen Charles E, Leiserson Ronald L Rivest Clifford Stein, MIT press. • Lecture slides and programing examples will also be shared after very class 5
  • 6. About the course 6 Assessments Quantity Percentage Quizzes 5 20% Projects 2 20% Mid-Terms 2 30% Final Exam 1 30%
  • 7. About the course  Regular Lectures: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday: 09:00 AM to 10:50AM  Consultation Hours: You can send me an email at any time. 7
  • 8. Introduction  Definition  Basic Data Structures  Choosing a Data Structure ◦ Examples  Data Structure operations 8
  • 9. Definition ◦ A data structure is a way to store and organize data in order to facilitate access and modifications ◦ No single data structure works well for all purposes, and so it is important to know the strengths and limitations of several of them 9
  • 10. Basic Data Structures 10 Basic Data Structures Linear Data Structures Non-Linear Data Structures Arrays LinkedLists Stacks Queues Trees Graphs Hash Tables
  • 11. What data structure to use? 11 array Linked list tree queue stack
  • 12. Choosing a Data Structures  The choice of particular data model depends on two consideration: ◦ It must be rich enough in structure to mirror the actual relationships of data in the real world ◦ The structure should be simple enough that one can effectively process the data when necessary 12
  • 13. Basic data structures  Linear structures ◦ Array: Fixed-size ◦ Linked-list: Variable-size ◦ Stack: Add to top and remove from top ◦ Queue: Add to back and remove from front ◦ Priority queue: Add anywhere, remove having highest priority  Hash tables: Unordered lists which use a ‘hash function’ to insert and search  Tree: A branching structure with no loops  Graph: A Graph consist of a set of vertices V and a set of edges E 13
  • 14. Arrays  Linear array : A list of a finite number n of similar data elements referenced respectively by a set of n consecutive numbers  Also known as one dimensional arrays 14 STUDENT Usman Saleem Usama Arshad Nasir Fida Tayyab Ahmad Abdullah Musa Ahmad 1 2 3 4 5 6
  • 15. Arrays  Multidimensional arrays ◦ Each elements is referenced by two subscripts ◦ For example, weekly sales record of a chain of 28 stores, each having 4 depts 15
  • 16. Linked List  Suppose a firm maintains a file, as shown here  This file could be stored in the computer by two columns of nine names  However, there is redundant information in such a scheme, especially if we have hundreds of names 16 Customer Salesperson Adams Smith Brown Ray Clark Jones Evans Smith Farmer Jones Drew Jones Geller Ray Hill Smith Infeld Ray 1 2 3 4 5 6 7 8 9
  • 17. Alternate representation 17 Salesperson Jones Ray Smith Customer Pointer Adams 3 Brown 2 Clark 1 Evans 2 Farmer 3 Farmer 1 Geller 2 Hill 3 Infeld 2 1 2 3 4 5 6 7 8 9 3 2 1 An integer used as a pointer requires less space than a name: hence this representation saves space.
  • 18. Alternate representation (cont.)  Now suppose the firm wants the list of customers for a given salesperson ◦ Using the data representation in last slide, search is to be carried out through the entire file ( not a good solution)  Any Solution? ◦ Arrows to point the other way 18
  • 19. Another representation 19 Salesperson Pointer Jones 3, 6 Ray 2, 4, 7, 9 Smith 1, 5, 8  Can you think of any disadvantage associated with this scheme ? ◦ Set of pointers will change as customers are added and deleted, because each salesperson may have many pointers
  • 20. Still another representation 20 Customer Pointer Adams 5 Brown 4 Clark 6 Evans 7 Farmer 8 Farmer 0 Geller 9 Hill 0 Infeld 0 1 2 3 4 5 6 7 8 9 Salesperson Pointers Jones 3 Ray 2 Smith 1 3 2 1 Now we can easily insert and delete customers This representation is an example of linked list
  • 21. Hierarchical relationship  Data frequently contain a hierarchical relationship between various elements  Data structure used to reflect such kind of relationship is called a rooted tree graph or simply a tree.  For example, an employee personal record may contain the following data items: ◦ Social security number, ◦ Name, ◦ Address, ◦ Age, ◦ Salary, ◦ Dependents  However Name is composed of subitems, ◦ Last, ◦ First ◦ MI (middle initial)  Similarly we have address item 21
  • 22. Trees 22 22 City Province Country Area Street Address Name Last First MI CNIC # Age Salary Dependent Employee
  • 23. Example  Consider the following algebraic expression ◦ (2x+y)(a-7b)3 ◦ How can we represent such a data structure? 23
  • 25. Other data structures  Stack (LIFO) ◦ E.g., stack of dishes  Queue (FIFO) ◦ E.g., line of people waiting at bus stand  Graph ◦ Sometimes relationship between pairs of data elements is not hierarchical. 25
  • 28. The Need for Data Structures  Goal: to organize data  Criteria: to facilitate efficient ◦ storage of data ◦ retrieval of data ◦ manipulation of data  Design Issue: ◦ select and design appropriate data types. (This is the real essence of OOP.) 28
  • 29. After Class Dicussion (Self Test)  Differentiate static and dynamic data structure.  Why Data structure is necessory?  What are the limitations of algorithms?  How the efficiency of an algorithm can be measured ? 29