Week 1: Theoretical Analysis of algorithm

advertisement
Week 1: Theoretical Analysis of algorithm
Goal: given an algorithm in pseudo-code, estimate the running time in terms of big O
notation.
Concepts:
1. Primitive operations (slide 15)
2. Counting primitive operations for a given algorithm. (An example is in Slide 16)
3. Big O notation. (slides 20-25)
Example:
Algorithm 1:
For (i=0; i<=n; i++)
For (j=0; j<=n; j++)
Print(a[i. j]);
The running time is O(n2).
Week 2: Stack
1. ADT
2. Stack ADT
3. array-based stack
4. Applications of stack: parentheses matching (slides 14-18)
5. Queue ADT
Week 3:
Linked list
Singly linked list and doubly linked list
Euler circuit is not required at present.
Know the algorithm and codes for insertion and deletion.
Merge two linked list into one.
Week 4: Trees
1.
2.
3.
4.
Recusion.
Tree
Binary tree
Inorder traversal (for binary tree)
Week 5: More on trees
1. Preorder
2. 2. Postorder
3. linked structure for binary tree
4. array-based binary tree representation
Week 6: Heap
1. Priority Queue ADT (slide 2)
2.
3.
4.
5.
heaps
operation for heaps: insertion, removMin
running time for each operation O(log n).
Build a heap of n item in O(n) time.
Week 7. Hash table
1. The motivations of a hash table.
2. hash function: hash code, and compression code
3. collision handling: linear probing and double hash
Week 8: Binary search tree
1. definition of binary search tree
2. operations: search, insertion, deletion
Download