Ders1 - Basic Concepts For Data Structures
Ders1 - Basic Concepts For Data Structures
VERİ YAPILARI VE
ALGORİTMALARI
• Dr. Öğretim Üyesi Adnan Özsoy
• adnan.ozsoy@hacettepe.edu.tr
• Office : 114
• Ders: 18.15 – D9
• 18.30?
About the course
• This course will help students understand the basic data
structures such as matrices, stacks, queues, linked lists,
etc.
References
• https://piazza.com/hacettepe.edu.tr/spring2020/bbs516
Notlandırma
• Ara Sınav : 30%
• Final : 40%
• Proje : 30% - 3 proje
Policies
• Work groups
• You must work alone on all assignments stated unless otherwise
• Submission
• Assignments due at 23:59 (no extensions!)
• Lateness penalties
• No late submission
• Only have one time 2 day late submission
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
• Detection of cheating:
• We do check: Our tools for doing this are much better than most
cheaters think!
Ders Programı:
Hatfa Konu
Feb.24 Giriş
Mar.02 Algoritma Analizi
Mar.09 Dizinler
Mar.16 Yığın ve Sıralar
Mar.23 Sıralama 1
Mar.30 Sıralama 2
Apr.06 SINAV
Apr.13 İfadeler
Apr.20 Bağlı Listeler 1
Apr.27 Bağlı Listeler 2
May.04 Arama Algoritmaları
May.11 Ağaç
May.18 Tries
May.25 HOLIDAY
TBD FINAL
BASIC CONCEPTS
FOR DATA STRUCTURES
Data StructuresàData StructurING
Mobile user?
• Find nearest point to me...
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;
}
YouTube's counter
previously used a 32-bit
integer
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
(~21 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
28
Goals
• Generates tensions:
• time vs. space
• performance vs. elegance
• generality vs. simplicity
• one operation’s performance vs. another’s
• adnan.ozsoy@hacettepe.edu.tr
• Office : 114
• Ders: 18.15 – D9
• 18.30?
• https://piazza.com/hacettepe.edu.tr/spring2020/bbs516