CS214 DS2024 Lec 1 Intro
CS214 DS2024 Lec 1 Intro
1.Course Objectives
2.Course Administration
3.Introduction to Data Structures
4.Revision
Course Rationale
• So far, you have acquired proficiency in
programming.
• This course starts to transform you from a
programmer to a computer scientist.
• CS scientist must make efficient use of
computational resources.
• This course will teach you about different
ways of organizing the data and
performing operations on them to facilitate
efficient use of resources.
Course Rationale
• It will also teach you to analyze the
efficiency of your program in a
mathematical manner.
• This is critical to your becoming a good
software developer later.
Course Objectives
• Understand the basic ADT and their
characteristics
• Learn how to decide on the suitable data
structure for an application.
• Implement basic data structures in C++
• Use existing data structures effectively in
applications.
• Learn algorithm complexity and efficiency
Course Objectives
• This IS NOT a course in object-oriented
programming!
Course Objectives
• It is efficient to:
▪ minimize the run time of code.
▪ minimize the memory / storage needs of code.
▪ recognize that there may be a trade-off
between speed and memory requirements.
▪ writing a program of higher quality.
▪ re-use code, instead of re-writing code.
Why do we study Data Structures?
• Obviously, the best organization of data in
the main memory optimizes the memory
usage and improves the performance of
the specified operations on data
• Professional programmers are the ones
who know how to select the appropriate
data structures to organize their data in
the main memory!
2. Course Administration
Basic Course Information
• Course Code: CS214
• Course Name: Data Structures
• Course Credit: 3 credits
Course on Google Classroom
• Class Name:
CS214-Data Structures-Fall2024
• Link to join:
https://classroom.google.com/c/NzA5OTI2M
zg2NDg4?cjc=5c42gzw
Student Assessment
(might be updated)
• Assessment aims to inform students of their
progress and evaluate their effort.
• Midterm 20%
• Coursework
▪ Assignments 12%
▪ Lab Participation 8%
• No mark for attendance. Mark is for doing lab work.
http://goo.gl/THfPJk
Course Syllabus
1. Introduction Week 1
2. Complexity Analysis Week 2
3. Searching and Sorting Algorithms Week 3, 4
4. Linked Lists Week 5
5. Stacks, Queues Week 6
6. Binary Trees-BST Week 7
7. Balanced Trees-Heaps Week 8
8. Graphs and Graph Algorithms Week 9,10
9. Hash Tables Week 11
Course Rules
• No late assignment delivery.
• Do not try cheating.
4. ADT, Algorithms and
Data Structures
D/S vs. Algorithms vs. ADT
ADT is a data type (or class) whose behavior is
defined by a set of values and a set of operations.
The definition of ADT only mentions what operations
are to be performed but not how these operations
will be implemented.
Algorithm:
Print (array[][n], n)
for i1 to n do
for j1 to n do
printElem (array [i][j])
Example #3
Algorithm:
search (array[ ], n, key)
for i1 to n do
if (key = array [i]) return true;
end for
return false;
• Here the for loop may run once if the key
is found at the beginning of the array or at
most n times when the key is not found in
the array, so ….
Best, Worst, and Average Time
Complexity
• we need to distinguish between three types of time
complexity analyses:
▪ Best case – how to estimate the minimum
number of steps required to solve a problem of
size n
▪ Worst case – how to estimate the maximum
number of steps required to solve a problem of
size n
▪ Average case – how to estimate the average
number of steps required to solve a problem of
size n (which greatly depends on the way data
is distributed/stored array!)
Why Algorithms are Important?
• If you have a hard problem that needs a lot of
time to solve, e.g. printing all subsets of a set of
n values)
▪ Any deterministic algorithm will perform at
least 2n printing steps to print all the subsets
of the set
▪ If we assume that our computer prints 100
subsets every second, so for a set of 100
elements, it will take more than 4x1018
centuries to complete the printing task
▪ Efficient hardware ??????
Why Algorithms are Important?
• Review C++