Professional Documents
Culture Documents
Lecture #10
Spring 2017
2
Case Study: [Data Processing] Students’ Grading ASTU
3
ASTU
4
ASTU
2 100 0 100 0
3 82 94 73 86
4 64 74 84 94
5 94 84 74 64
5
Searching and Sorting ASTU
6
Search Algorithms ASTU
7
Linear Search ASTU
8
Linear Search ASTU
9
Linear Search ASTU
10
Binary Search ASTU
11
Binary Search ASTU
12
Binary Search ASTU
13
Binary Search ASTU
14
Binary Search ASTU
15
Linear and Binary Search ASTU
16
Sort Algorithms ASTU
17
Selection Sort ASTU
18
Selection Sort ASTU
19
Selection Sort ASTU
20
Selection Sort ASTU
21
Selection Sort ASTU
22
Exchange (Bubble) Sort ASTU
23
Exchange (Bubble) Sort ASTU
• Number of comparisons
O(n2)
• Maximum number of comparisons
n(n-1)/2
• Maximum number of moves
n(n-1)/2
• Many moves are not final moves
25
Matrix Calculation ASTU
26
Matrix Calculation ASTU
27
Matrix Calculation ASTU
28
Assignment II ASTU
29
Dynamic Array Allocation ASTU
30
Dynamic Array Allocation ASTU
31
Dynamic Array Allocation ASTU
32
Dynamic Array Allocation Example ASTU
33
Pointer: Output Exercises ASTU
34
Pointer: Output Exercises ASTU
35