SlideShare a Scribd company logo
BBM 201
DATA STRUCTURES
Lecture 1:
Basic concepts for data structures
About the course
• This course will help students understand the basic data
structures such as matrices, stacks, queues, linked lists,
etc.
• BBM 203 Programming Laboratory: The students will
gain hand-on experience via a set of programming
assignments supplied as complementary.
• Requirements: You must know basic programming (i.e.
BBM101).
References
• Data Structures and Algorithm Analysis in C++. 4th
Edition. Mark Allen Weiss, Pearson, 2014
• Fundamentals of Data Structures in C++. Ellis Horowitz,
Sartaj Sahni, and Susan Anderson-Freed, Computer
Science Press, 1995.
• Data Structures Notes, Mustafa Ege.
•
Communication
• The course web page will be updated regularly throughout
the semester with lecture notes, programming
assignments, announcements and important deadlines.
http://web.cs.hacettepe.edu.tr/~bbm201
Getting Help
• Office hours
See the web page for details
• BBM 203 Programming Laboratory
Course related recitations, practice with example codes, etc.
• Communication
Announcements and course related discussions through
BBM 201: https://piazza.com/hacettepe.edu.tr/fall2021/bbm201
BBM 203: https://piazza.com/hacettepe.edu.tr/fall2021/bbm203
Course Work and Grading
• 1 midterm exam (25%)
• Quizzes (25%) (5 out of 6)
• Final exam (50%)
Course Overview
BBM 203 Programming Laboratory I
• Programming assignments (PAs)
• Four assignments throughout the semester.
• Each assignment has a well-defined goal such as solving a specific
problem.
• You must work alone on all assignments stated unless otherwise.
BBM 203 Programming Laboratory I
Policies
• Work groups
• You must work alone on all assignments stated unless otherwise
• Submission
• Assignments due at 23:59 (no extensions!)
• Electronic submissions (no exceptions!)
• Lateness penalties
• No late submission is accepted
Cheating
• What is cheating?
• Sharing code: by copying, retyping, looking at, or supplying a file
• Coaching: helping your friend to write a programming assignment, line by line
• Copying code from previous course or from elsewhere on WWW
• What is NOT cheating?
• Explaining how to use systems or tools
• Helping others with high-level design issues
Cheating
• Penalty for cheating:
• Suspension from school for 6 months (minimum)
• Detection of cheating:
• We do check: Our tools for doing this are much better than most
cheaters think!
BASIC CONCEPTS
FOR DATA STRUCTURES
Data Structures→Data StructurING
How do we organize information so that we can find,
update, add, and delete portions of it efficiently?
Data Structure Example Applications
• How does Google quickly find web pages that contain a
search term?
• What’s the fastest way to broadcast a message to a network of
computers?
• How can a subsequence of DNA be quickly found within the
genome?
• How does your operating system track which memory (disk or
RAM) is free?
• In the game Half-Life, how can the computer determine which
parts of the scene are visible?
Suppose You’re Google Maps…
• You want to store data about cities (location, elevation,
population)…
What kind of operations should your data structure(s) support?
Operations to support the following scenario…
Finding addresses on map?
• Lookup city by name...
Mobile user?
• Find nearest point to me...
Car GPS system?
• Calculate shortest-path
between cities…
• Show cities within a given
window…
Political revolution?
• Insert, delete, rename cities
How will you count user views on YouTube?
• Lets write a userViewCount() function
int userViewCount (int
current_count)
{
int new_count;
new_count =current_count + 1;
return new_count;
}
Will this implementation
work all the time?
How will you count user views on YouTube?
%99.9 times yes.
How will you count user views on YouTube?
http://www.bbc.com/news/world-asia-
30288542
YouTube's counter
previously used a 32-bit
integer
YouTube said the video - its
most watched ever - has
been viewed more than
2,147,483,647 times.
It has now changed the
maximum view limit to
9,223,372,036,854,775,808,
or more than nine quintillion.
http://www.economist.com/blogs/economist-
explains/2014/12/economist-explains-6
How bad can it be?
• June 4, 1996
• Ariane 5 rocket launched by the European Space Agency
• After a decade of development costing $7 Billion
(~42 Billion in Turkish Liras, just for comparison Istanbul’s
third bridge cost estimates are 4.5 Billion TL)
• Exploded just 40 seconds after its lift-off
• The destroyed rocket and its cargo were valued at $500
million
• Reason?
How bad can it be?
• Reason?
• Inertial reference system error: specifically a 64 bit
floating point number relating to the horizontal velocity of
the rocket with respect to the platform was converted to a
16 bit signed integer.
• The number was larger than 32,767, the largest integer
storable in a 16 bit signed integer, and thus the
conversion failed.
• $500 Million rocket/cargo
• Time and effort
Floating Point Representation
Floating Point Representation
Goals
“I will, in fact, claim that the difference between a bad
programmer and a good one is whether he considers his
code or his data structures more important. Bad
programmers worry about the code. Good programmers
worry about data structures and their relationships.”
Linus Torvalds, 2006
30
Data Structures
A data structure is a way to
store and organize data in
computer, so that it can be
used efficiently.
Some of the more commonly
used data structures include
lists, arrays, stacks, queues,
heaps, trees, and graphs. Binary Tree
What are data structures?
• Data structures are software artifacts that allow data to be
stored, organized and accessed.
• Ultimately data structures have two core functions: put
stuff in and take stuff out.
Why so many?
• Space efficiency
• Time efficiency:
• Store
• Search
• Retrieve
• Remove
• Clone etc.
Choosing Data Structures
Queue vs Binary Tree
---Which one to use for what
task?
Why So Many Data Structures?
• Ideal data structure:
• “fast”, “elegant”, memory efficient
• Generates tensions:
• time vs. space
• performance vs. elegance
• generality vs. simplicity
• one operation’s performance vs. another’s
The study of data structures is the study of
tradeoffs. That’s why we have so many of
them!

More Related Content

Similar to Lecture 1

Machine Learning
Machine LearningMachine Learning
Machine Learning
Ramiro Aduviri Velasco
 
Database :Introduction to Database System
Database :Introduction to Database SystemDatabase :Introduction to Database System
Database :Introduction to Database System
ZakriyaMalik2
 
Machine learning in Banks
Machine learning in BanksMachine learning in Banks
Machine learning in Banks
Abhishek Upadhyay
 
From SQL to Python - A Beginner's Guide to Making the Switch
From SQL to Python - A Beginner's Guide to Making the SwitchFrom SQL to Python - A Beginner's Guide to Making the Switch
From SQL to Python - A Beginner's Guide to Making the Switch
Rachel Berryman
 
Unit no_1.pptx
Unit no_1.pptxUnit no_1.pptx
Unit no_1.pptx
Ganeshpatil499846
 
What is Data as a Service by T-Mobile Principle Technical PM
What is Data as a Service by T-Mobile Principle Technical PMWhat is Data as a Service by T-Mobile Principle Technical PM
What is Data as a Service by T-Mobile Principle Technical PM
Product School
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
Tao Xie
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
Dios Kurniawan
 
E Learning Management System By Tuhin Roy Using PHP
E Learning Management System By Tuhin Roy Using PHPE Learning Management System By Tuhin Roy Using PHP
E Learning Management System By Tuhin Roy Using PHP
Tuhin Ray
 
Data Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps ApproachData Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps Approach
Mihai Criveti
 
DMP & DMPonline
DMP & DMPonlineDMP & DMPonline
DMP & DMPonline
Sarah Jones
 
Tech essentials for Product managers
Tech essentials for Product managersTech essentials for Product managers
Tech essentials for Product managers
Nitin T Bhat
 
The Download: Tech Talks by the HPCC Systems Community, Episode 12
 The Download: Tech Talks by the HPCC Systems Community, Episode 12 The Download: Tech Talks by the HPCC Systems Community, Episode 12
The Download: Tech Talks by the HPCC Systems Community, Episode 12
HPCC Systems
 
Data Privacy at Scale
Data Privacy at ScaleData Privacy at Scale
Data Privacy at Scale
DataWorks Summit
 
Vitriol
VitriolVitriol
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
iqbalphy1
 
Classroom of the futurev3
Classroom of the futurev3Classroom of the futurev3
Classroom of the futurev3
Ronald J. Kantor, Ph.D - PMP
 
Webinar - Office Productivity in the Cloud - 2016-08-18
Webinar - Office Productivity in the Cloud - 2016-08-18Webinar - Office Productivity in the Cloud - 2016-08-18
Webinar - Office Productivity in the Cloud - 2016-08-18
TechSoup
 
Relevancy and Search Quality Analysis - Search Technologies
Relevancy and Search Quality Analysis - Search TechnologiesRelevancy and Search Quality Analysis - Search Technologies
Relevancy and Search Quality Analysis - Search Technologies
enterprisesearchmeetup
 
Concepts, use cases and principles to build big data systems (1)
Concepts, use cases and principles to build big data systems (1)Concepts, use cases and principles to build big data systems (1)
Concepts, use cases and principles to build big data systems (1)
Trieu Nguyen
 

Similar to Lecture 1 (20)

Machine Learning
Machine LearningMachine Learning
Machine Learning
 
Database :Introduction to Database System
Database :Introduction to Database SystemDatabase :Introduction to Database System
Database :Introduction to Database System
 
Machine learning in Banks
Machine learning in BanksMachine learning in Banks
Machine learning in Banks
 
From SQL to Python - A Beginner's Guide to Making the Switch
From SQL to Python - A Beginner's Guide to Making the SwitchFrom SQL to Python - A Beginner's Guide to Making the Switch
From SQL to Python - A Beginner's Guide to Making the Switch
 
Unit no_1.pptx
Unit no_1.pptxUnit no_1.pptx
Unit no_1.pptx
 
What is Data as a Service by T-Mobile Principle Technical PM
What is Data as a Service by T-Mobile Principle Technical PMWhat is Data as a Service by T-Mobile Principle Technical PM
What is Data as a Service by T-Mobile Principle Technical PM
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
E Learning Management System By Tuhin Roy Using PHP
E Learning Management System By Tuhin Roy Using PHPE Learning Management System By Tuhin Roy Using PHP
E Learning Management System By Tuhin Roy Using PHP
 
Data Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps ApproachData Science at Scale - The DevOps Approach
Data Science at Scale - The DevOps Approach
 
DMP & DMPonline
DMP & DMPonlineDMP & DMPonline
DMP & DMPonline
 
Tech essentials for Product managers
Tech essentials for Product managersTech essentials for Product managers
Tech essentials for Product managers
 
The Download: Tech Talks by the HPCC Systems Community, Episode 12
 The Download: Tech Talks by the HPCC Systems Community, Episode 12 The Download: Tech Talks by the HPCC Systems Community, Episode 12
The Download: Tech Talks by the HPCC Systems Community, Episode 12
 
Data Privacy at Scale
Data Privacy at ScaleData Privacy at Scale
Data Privacy at Scale
 
Vitriol
VitriolVitriol
Vitriol
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
Classroom of the futurev3
Classroom of the futurev3Classroom of the futurev3
Classroom of the futurev3
 
Webinar - Office Productivity in the Cloud - 2016-08-18
Webinar - Office Productivity in the Cloud - 2016-08-18Webinar - Office Productivity in the Cloud - 2016-08-18
Webinar - Office Productivity in the Cloud - 2016-08-18
 
Relevancy and Search Quality Analysis - Search Technologies
Relevancy and Search Quality Analysis - Search TechnologiesRelevancy and Search Quality Analysis - Search Technologies
Relevancy and Search Quality Analysis - Search Technologies
 
Concepts, use cases and principles to build big data systems (1)
Concepts, use cases and principles to build big data systems (1)Concepts, use cases and principles to build big data systems (1)
Concepts, use cases and principles to build big data systems (1)
 

Recently uploaded

Connect to Grow: The power of building networks
Connect to Grow: The power of building networksConnect to Grow: The power of building networks
Connect to Grow: The power of building networks
Eirini SYKA-LERIOTI
 
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
gnokue
 
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
nguqayx
 
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdfSwitching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
SocMediaFin - Joyce Sullivan
 
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
kkkkr4pg
 
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
aweuwyo
 
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
ahmedendrise81
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
Bruce Bennett
 
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
GabrielleSinaga
 
Khushi Saini, An Intern from The Sparks Foundation
Khushi Saini, An Intern from The Sparks FoundationKhushi Saini, An Intern from The Sparks Foundation
Khushi Saini, An Intern from The Sparks Foundation
khushisaini0924
 
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
ahmedendrise81
 
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
1wful2fm
 
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
cenaws
 
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
evnum
 
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
yhkox
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
taqyea
 
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAANBUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
cahgading001
 
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
karimimorine448
 
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
evnum
 
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
lemike859
 

Recently uploaded (20)

Connect to Grow: The power of building networks
Connect to Grow: The power of building networksConnect to Grow: The power of building networks
Connect to Grow: The power of building networks
 
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
一比一原版(surrey毕业证书)英国萨里大学毕业证成绩单修改如何办理
 
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
一比一原版(EUR毕业证)鹿特丹伊拉斯姆斯大学毕业证如何办理
 
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdfSwitching Careers Slides - JoyceMSullivan SocMediaFin -  2024Jun11.pdf
Switching Careers Slides - JoyceMSullivan SocMediaFin - 2024Jun11.pdf
 
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
办理阿卡迪亚大学毕业证(uvic毕业证)本科文凭证书原版一模一样
 
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
一比一原版(uwm毕业证书)美国威斯康星大学密尔沃基分校毕业证如何办理
 
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
 
A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024A Guide to a Winning Interview June 2024
A Guide to a Winning Interview June 2024
 
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
Gabrielle M. A. Sinaga Portfolio, Film Student (2024)
 
Khushi Saini, An Intern from The Sparks Foundation
Khushi Saini, An Intern from The Sparks FoundationKhushi Saini, An Intern from The Sparks Foundation
Khushi Saini, An Intern from The Sparks Foundation
 
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
美洲杯买球-美洲杯买球下注平台-美洲杯买球投注平台|【​网址​🎉ac55.net🎉​】
 
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
一比一原版美国西北大学毕业证(NWU毕业证书)学历如何办理
 
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
一比一原版坎特伯雷大学毕业证(UC毕业证书)学历如何办理
 
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
按照学校原版(UofT文凭证书)多伦多大学毕业证快速办理
 
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
在线办理(UOIT毕业证书)安大略省理工大学毕业证在读证明一模一样
 
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
一比一原版布拉德福德大学毕业证(bradford毕业证)如何办理
 
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAANBUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
BUKU PENJAGAAN BUKU PENJAGAAN BUKU PENJAGAAN
 
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
 
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
按照学校原版(ArtEZ文凭证书)ArtEZ艺术学院毕业证快速办理
 
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩体育投注-欧洲杯足彩投注网站|【​网址​🎉ac99.net🎉​】
 

Lecture 1

  • 1. BBM 201 DATA STRUCTURES Lecture 1: Basic concepts for data structures
  • 2. About the course • This course will help students understand the basic data structures such as matrices, stacks, queues, linked lists, etc. • BBM 203 Programming Laboratory: The students will gain hand-on experience via a set of programming assignments supplied as complementary. • Requirements: You must know basic programming (i.e. BBM101).
  • 3. References • Data Structures and Algorithm Analysis in C++. 4th Edition. Mark Allen Weiss, Pearson, 2014 • Fundamentals of Data Structures in C++. Ellis Horowitz, Sartaj Sahni, and Susan Anderson-Freed, Computer Science Press, 1995. • Data Structures Notes, Mustafa Ege. •
  • 4. Communication • The course web page will be updated regularly throughout the semester with lecture notes, programming assignments, announcements and important deadlines. http://web.cs.hacettepe.edu.tr/~bbm201
  • 5. Getting Help • Office hours See the web page for details • BBM 203 Programming Laboratory Course related recitations, practice with example codes, etc. • Communication Announcements and course related discussions through BBM 201: https://piazza.com/hacettepe.edu.tr/fall2021/bbm201 BBM 203: https://piazza.com/hacettepe.edu.tr/fall2021/bbm203
  • 6. Course Work and Grading • 1 midterm exam (25%) • Quizzes (25%) (5 out of 6) • Final exam (50%)
  • 8. BBM 203 Programming Laboratory I • Programming assignments (PAs) • Four assignments throughout the semester. • Each assignment has a well-defined goal such as solving a specific problem. • You must work alone on all assignments stated unless otherwise.
  • 9. BBM 203 Programming Laboratory I
  • 10. Policies • Work groups • You must work alone on all assignments stated unless otherwise • Submission • Assignments due at 23:59 (no extensions!) • Electronic submissions (no exceptions!) • Lateness penalties • No late submission is accepted
  • 11. Cheating • What is cheating? • Sharing code: by copying, retyping, looking at, or supplying a file • Coaching: helping your friend to write a programming assignment, line by line • Copying code from previous course or from elsewhere on WWW • What is NOT cheating? • Explaining how to use systems or tools • Helping others with high-level design issues
  • 12. Cheating • Penalty for cheating: • Suspension from school for 6 months (minimum) • Detection of cheating: • We do check: Our tools for doing this are much better than most cheaters think!
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Data Structures→Data StructurING How do we organize information so that we can find, update, add, and delete portions of it efficiently?
  • 20. Data Structure Example Applications • How does Google quickly find web pages that contain a search term? • What’s the fastest way to broadcast a message to a network of computers? • How can a subsequence of DNA be quickly found within the genome? • How does your operating system track which memory (disk or RAM) is free? • In the game Half-Life, how can the computer determine which parts of the scene are visible?
  • 21. Suppose You’re Google Maps… • You want to store data about cities (location, elevation, population)… What kind of operations should your data structure(s) support?
  • 22. Operations to support the following scenario… Finding addresses on map? • Lookup city by name... Mobile user? • Find nearest point to me... Car GPS system? • Calculate shortest-path between cities… • Show cities within a given window… Political revolution? • Insert, delete, rename cities
  • 23. How will you count user views on YouTube? • Lets write a userViewCount() function int userViewCount (int current_count) { int new_count; new_count =current_count + 1; return new_count; } Will this implementation work all the time?
  • 24. How will you count user views on YouTube? %99.9 times yes.
  • 25. How will you count user views on YouTube? http://www.bbc.com/news/world-asia- 30288542 YouTube's counter previously used a 32-bit integer YouTube said the video - its most watched ever - has been viewed more than 2,147,483,647 times. It has now changed the maximum view limit to 9,223,372,036,854,775,808, or more than nine quintillion. http://www.economist.com/blogs/economist- explains/2014/12/economist-explains-6
  • 26. How bad can it be? • June 4, 1996 • Ariane 5 rocket launched by the European Space Agency • After a decade of development costing $7 Billion (~42 Billion in Turkish Liras, just for comparison Istanbul’s third bridge cost estimates are 4.5 Billion TL) • Exploded just 40 seconds after its lift-off • The destroyed rocket and its cargo were valued at $500 million • Reason?
  • 27. How bad can it be? • Reason? • Inertial reference system error: specifically a 64 bit floating point number relating to the horizontal velocity of the rocket with respect to the platform was converted to a 16 bit signed integer. • The number was larger than 32,767, the largest integer storable in a 16 bit signed integer, and thus the conversion failed. • $500 Million rocket/cargo • Time and effort
  • 30. Goals “I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships.” Linus Torvalds, 2006 30
  • 31. Data Structures A data structure is a way to store and organize data in computer, so that it can be used efficiently. Some of the more commonly used data structures include lists, arrays, stacks, queues, heaps, trees, and graphs. Binary Tree
  • 32. What are data structures? • Data structures are software artifacts that allow data to be stored, organized and accessed. • Ultimately data structures have two core functions: put stuff in and take stuff out.
  • 33. Why so many? • Space efficiency • Time efficiency: • Store • Search • Retrieve • Remove • Clone etc.
  • 34. Choosing Data Structures Queue vs Binary Tree ---Which one to use for what task?
  • 35. Why So Many Data Structures? • Ideal data structure: • “fast”, “elegant”, memory efficient • Generates tensions: • time vs. space • performance vs. elegance • generality vs. simplicity • one operation’s performance vs. another’s The study of data structures is the study of tradeoffs. That’s why we have so many of them!