0% found this document useful (0 votes)
20 views

Lecture 1 - Intro

asd

Uploaded by

toprakcihalil0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lecture 1 - Intro

asd

Uploaded by

toprakcihalil0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

SE 2005

DATA
STRUCTURES

Introduction to
Data structures
COURSE INFORMATION
• All Announcement: Syllabus, Lecture notes, etc. will be on
https://dys.mu.edu.tr/
– Sharing lecture notes on the internet is forbidden!

• Grading Policy: 30% Midterm Exam, 20% Quizes/Homeworks,/Lab assignments,


50% Final Exam

• Attendance Policy: You should attend at least 70% of classes to pass the
course.
– Means that you should attend approx. 10 lectures out of 14.

• Plagiarism and Cheating Policy: Zero-tolerance!


GETTING HELP
• Office hours:
– Tuesday 13:00 – 15:00, at building
«Faculty of Engineering», Block E,
– Or, email to schedule an appointment.

• You can always email me


– eliftulay@mu.edu.tr
Is there any
one who
know C or
C++?
C PROGRAMMING LANGUAGE
• You will be using the C programming language in this course
WHY C?
• You can store data in an organized and efficient manner. Memory
management process is easier.
• Due to the absence of Object Oriented Paradigm, there are no operator
overloading and function overloading problems in C
• C is a significantly simpler language and more transparent
• C allows you to create your own data type using 'structures’
• It has been long time to use C++, sorry I do not remember :D
SUGGESTED BOOKS
GOALS Understanding,
implementing, using,
Become familiar performing different
with some of the
operations on variety
fundamental data
structures in of data structures
computer
science

Applying several
basic algorithms
on variety of
Improving
data structures
programming
skills in C
CONTENT
• Pointers • Sorting Queues
• Linked Lists • Searching
• Stacks • Insertion
• Queues • Deletion
• Heaps • Merging
• Trees
• Graphs
Stacks
SYLLABUS
Week (Lec - Lab) Topic
Week 1 Introduction to Data Structures
Week 2 Pointers
Week 3 C Structures - Memory Management
Week 4 LAB
Week 5 Linked Lists - 1
Week 6 Linked Lists - 2
Week 7 LAB This outline shows the
Week 8 Stack & Queue list of topics associated
with each class meeting.
Week 9 LAB
Week 10 Trees - 1 However, it is tentative
Week 11 Trees - 2 - Heap and subject to change as
Week 12 LAB seen necessary and
Week 13 Graphs appropriate during the
Week 14 Wrap-Up semester.
LAB SESSIONS
Hasan Yiğit
The research assistant in our department

You will be given a lab assignment to complete.

Lab assignments are individual but you can discuss


the assignment with your classmates to understand
the duty and concepts and to make learning
easier

We will start the lab sessions in the 4th week!


Advices for success!
HOW TO BE SUCCESFUL IN THIS COURSE

1 2 3 4
Follow the Read the Search on the Get your hands
lectures and the textbooks and internet for the dirty
labs lecture notes parts that you • Do the exercises in
Not for a grade but to did not front of the
learn and get better understand computer
clearly
You cannot learn to play the
piano just by watching
someone’s piano lecture,
even if that someone is the
best pianist in the world!

Frank Stajano
KEEP IN MIND
• Be disciplined and aware of your
responsibilities
• In class
• In everday life 1
• Be on time
• For class
• For appointments
• For your duties
2
• Be respectful
• To your instructors
• To your classmates 3
FORBIDDEN
DO NOT sign the attendence list for someone else!!

 It is not  It is
 Ethical  Dangerous
 Legal  Strictly forbidden
FAIRNESS
• It is sometimes a difficult thing
to provide fairness in a crowded
class.

• If you feel something is not fair,


you need to let me know
DO NOT HESITATE TO ASK FOR HELP
Do Not Be Afraid to
Ask For Help Early

It is not a sign of
weakness
LAST
BUT American football player

NOT
LEAST Don't give up!

Your education is the most important thing


you can do for your future.
INTRODUCTION TO
D ATA S T R U C T U R E
What is Data?

Data can be defined as


an elementary value or
the collection of values
DIGITAL DATA MUST BE…
• Encoded (e.g 01011010 -> )

• Arranged
– Stored in an orderly way in memory

• Accessed Focus of this class


– Insert new data
– Remove old data
– Find data

• Processed
– Algorithms: shortest path etc.
Data Structure is a special way of
organizing and storing data in a computer
in order to facilitate access and
modification so that data can be used
efficiently.
Any operation can be These data structures do not allow any
performed in these data specific instruction to be performed on
items the data items directly.

data elements
arranged in
sequential
manner
data elements
arranged in non-
Associated memory Associated memory sequential manner
locations are fixed locations changes
WHY WE NEED DATA STRUCTURES?
Efficient Memory use: With efficient use of data structure memory usage can be
optimized, for e.g we can use linked list vs arrays when we are not sure about the
size of data.

Speed: To handle big data, we need to organize the data in proper way so
Manipulation of large amount of data can be carried out easily

Reusability: Implementation of data structures can be compiled into libraries


which can be used by different clients.

Abstraction: Data structure serves as the basis of abstract data types, the data
structure defines the physical form of ADT(Abstract Data Type).
WHICH OPERATIONS WE CAN
PERFORM?
• Traversing: Traversing the data structure means visiting each element of the data structure in
order to perform some specific operation like searching or sorting.
• Insertion: Insertion can be defined as the process of adding the elements to the data structure at
any location.
• Deletion: The process of removing an element from the data structure is called Deletion. We can
delete an element from the data structure at any random location.
• Searching: The process of finding the location of an element within the data structure is called
Searching. There are two algorithms to perform searching, Linear Search and Binary Search.
• Sorting: The process of arranging the data structure in a specific order is known as Sorting. There
are many algorithms that can be used to perform sorting, for example, insertion sort, selection sort,
bubble sort, etc.
• Merging: When two lists List A and List B of size M and N respectively, of similar type of elements,
clubbed or joined to produce the third list, List C of size (M+N), then this process is called merging
No single data structure works well for all
purposes, so it is important to know the
strengths and limitations of them

Although searching an array is very efficient,


adding and deleting is not.

Although adding and deleting in a linked list is


efficient, searching is not because we must use a
sequential search.
Is data structure enough to create a high
qualified programs?
Data structures and algorithms are closely related.

Data structures are often tuned for certain algorithms.


WHY ARE DATA STRUCTURES AND
ALGORITHMS TOGETHER?
Bookshelf
• You can consider
– the bookshelf as the data structure,
– the books as the data.

• Suppose you wanted to find a certain


book on the bookshelf, or sort the books
in a certain order.
– that’s where we use an algorithm.
“Get your data structures correct first, and
the rest of the program will write itself.”

David Jones

You might also like