120 likes | 173 Views
Course Introduction. CS 1037 Fundamentals of Computer Science II. Course Info. Subject: C++, data structures, algorithms Marks: 20% assignments + 5% weekly labs 30% midterm + 45% final People: Andrew, Mohsin, Ganesh, Da, Anthony, Jenny
E N D
Course Introduction CS 1037 Fundamentals of Computer Science II
Course Info • Subject: • C++, data structures, algorithms • Marks: • 20% assignments + 5% weekly labs • 30% midterm + 45% final • People: • Andrew, Mohsin, Ganesh, Da, Anthony, Jenny • Assignments, labs, announcements… http://www.csd.uwo.ca/courses/CS1037a/
You Should Already Know… • Variables, built-in types • Arrays (just the basics) • Functions, if-else, loops intnum_students = 68; intgrades[68]; grades[7] = -100; // die cheater die intaverage_grade() { intsum = 0; for (inti = 0; i < num_students; ++i) sum += grades[i]; return sum / num_students;}
You'll Learn… Lots More C++ • Pointers & References • Templates • Classes int* b = &a; // b points to a int& c = a; // c refers to a intmax(int a, int b) { // works only for int if (a < b) return b; else return a; } template <typenameT> T max(T a, T b) { // works for any type (int, float, char) if (a < b) return b; else return a; } class circle { point center; int radius; void draw(); };
You'll Learn… Data Structures • Dynamic Arrays • Linked Lists • Stacks, Queues • Trees dynarray<int> grades(num_students); grades[7] = -100; // die cheater die linkedlist<int> courses; courses.push_front(1037); queue<char> keys; keys.push_back('A'); binarytree<string> presidents; presidents.insert("Obama");
You'll Learn… Algorithms • Sorting • Searching • Asymptotic Analysis (what do you mean by “fast”?) int prices[4] = { 8, 15, 1, 10 }; sort(prices, prices+4); // prices = { 1, 8, 10, 15 } int pos = binary_search(prices, prices+4, 10); // pos = 2 O(1) O(logn) O(n) O(n2) O(2n) means “fast” time n # items means “slow”
Programming Skills Take Time! CS2210 SE2205 CS1037 effectiveness of you CS1036 stuff in your brain variables if-else loops arrays pointers functions structs classes templates sorting lists/queues trees graphs hashing more…
distributed computing computability theory operating systems Big Universe of Ideas! optimization networking virtual machines compilers data mining user interfaces parsing C C# version control interpreters file I/O Java symbolic computation Python debugging UML rasterization polymorphism multisets profiling exceptions assertions inheritance physics simulation dictionaries portability templates variables structs linear algebra balanced trees hashing databases if-else iterators loops classes security matching arrays pointers encapsulation stacks float arithmetic searching lists functions sorting threads recursion concurrency clustering references queues assembly trees compression heaps combinatorics finite automata graphs caching big-O greedy algorithms GPUs proof techniques NP-completeness backtracking randomized algorithms dynamic programming approximation algorithms reducibility
Language Popularity in 2010 source: http://www.langpop.com/
BjarneStroustrup on C++ “Within C++, there is a much smaller and cleaner language struggling to get out.” “And no, that smaller and cleaner language is not Java or C#.” a fan Stroustrup started designing C++ in 1979, and is still working on it!
Goals of CS 1037 • Understand how to… • use data structures • implementdata structures • characterize an algorithm’s performance • express computation in C++ • Develop intuition about… • best data structure / algorithm for situation • good code, poor code, and dangerous code • Programming experience, confidence
Programmer Test Q: What does this statement do? • Question was strong predictor of success on 1988 Advanced Placement exam... b = b == false; "unusual patterns that emerged from a statistical analysis of the 1988 Advanced Placement Exam in Computer Science” —Stuart Reges, University of Washington