1.Algorithm: method for solving a problem.
Data structure: method to store infomation.
topic | data structures and algorithms |
---|---|
data types | stack, queue, bag, union-find, priority queue |
sorting | quicksort, mergesort, heapsort |
searching | BST, red-black BST, hash table |
graphs | BFS, DFS, Prim, Kruskal, Dijkstra |
strings | radix sorts, tries, KMP, regexps, data compression |
advanced | B-tree, suffix array, maxflow |
2.why study algorithms?
2.1 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, …
2.2 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!
2.3 To solve problems that could not otherwise be addressed.
Network connectivity.
2.4 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
“An algorithm must be seen to be believed.” —-Donald Knuth
2.5 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
2.6They may unlock the secrets of life and of the universe.
Computational models are replacing math models in scientific inquiry.
20th century science (formula based)
21st century science (algorithm based)
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]);
}
“Algorithms: a common language for nature, human, and computer.” —-Avi Wigderson
2.7 For fun and progit
jobs:
google, apple computer, facebook, cisco systems,
IBM, ORACLE, Adobe, Amazon.com, Microsoft, PIXAR,…