SENG 201
DATA AND GAME
STRUCTURES
SENG 201 course overview
What is SENG 201?
・Programming and problem solving, with applications.
・Algorithm: method for solving a problem.
・Data structure: method to store information.
topic data structures and algorithms
data types List, stack, queue, tree, priority queue, graphs
sorting Elementary sorts, mergesort, quicksort, heapsort
searching BST, hash table
2
Why study data structures and algorithms?
Their impact is broad and far-reaching.
Internet. Web search, packet routing, distributed file sharing, ...
Biology. Human genome project, protein folding, …
Computers. Circuit layout, file system, compilers, …
Computer graphics. Movies, video games, virtual reality, …
Security. Cell phones, e-commerce, voting machines, …
Multimedia. MP3, JPG, DivX, HDTV, face recognition, …
Social networks. Recommendations, news feeds, advertisements, …
Physics. N-body simulation, particle collision simulation, …
⋮
3
Why study data structures and algorithms?
Their impact is broad and far-reaching.
4
Why study data structures and algorithms?
Old roots, new opportunities.
・Study of algorithms dates at least to Euclid.
・Formalized by Church and Turing in 1930s.
・Some important algorithms were discovered
by undergraduates in a course like this!
1940s
300 BCE
1920s
1930s
1950s
1960s
1970s
1980s
1990s
2000s
5
Why study data structures and algorithms?
For intellectual stimulation.
“ For me, great algorithms are the poetry of computation. Just
like verse, they can be terse, allusive, dense, and even mysterious.
But once unlocked, they cast a brilliant new light on some
aspect of computing. ” — Francis Sullivan
6
Why study data structures and algorithms?
To become a proficient programmer.
“ 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 (creator of Linux)
“ Algorithms + Data Structures = Programs. ” — Niklaus Wirth
7
Why study data structures and algorithms?
They may unlock the secrets of life and of the universe.
Scientists are replacing mathematical models with computational models.
for (double t = 0.0; true; t = t + dt)
for (int i = 0; i < N; i++)
{
bodies[i].resetForce();
for (int j = 0; j < N; j++)
if (i != j)
bodies[i].addForce(bodies[j]);
}
20th century science 21st century science
(formula based) (algorithm based)
“ Algorithms: a common language for nature, human, and computer. ” — Avi Wigderson
8
Why study data structures and algorithms?
They may unlock the secrets of life and of the universe.
“ Computer models mirroring real life have become crucial for most
advances made in chemistry today…. Today the computer is just as
important a tool for chemists as the test tube. ”
— Royal Swedish Academy of Sciences
(Nobel Prize in Chemistry 2013)
Martin Karplus, Michael Levitt, and Arieh Warshel
9
Why study data structures and algorithms?
To solve problems that could not otherwise be addressed.
[Link]
10
Why study data structures and algorithms?
For fun and profit.
11
Resources (web)
14