, INDEX
S. No Topic Page No.
Week 1
1 Lecture 1 Part 1: Introduction 1
2 Lecture 1 Part 2 : Introduction 13
3 Lecture 1 Part 3 : Introduction 21
4 Lecture 1 Part 4 : Introduction 34
5 Lecture 2 Part 1 : Problem Solving using Computer 50
6 Lecture 2 Part 2 : Problem Solving using Computer 63
7 Lecture 2 Part 3 : Problem Solving using Computer 70
8 Lecture 2 Part 4 : Problem Solving using Computer 87
9 Lecture 2 Part 5 : Problem Solving using Computer 98
Week 2
10 Lecture 3 Part 1 : Basic Elements of Program 108
11 Lecture 3 Part 2 : Basic Elements of Program 120
12 Lecture 3 Part 3 : Basic Elements of Program 134
13 Lecture 3 Part 4 : Basic Elements of Program 144
14 Lecture 4 Part 1 : Program Design 151
15 Lecture 4 Part 2 : Program Design 157
16 Lecture 4 Part 3 : Program Design 166
17 Lecture 5 : Simple cpp Graphics 180
Week 3
18 Lecture 6 Part 1 : Conditional Execution 199
19 Lecture 6 Part 2 : Most general form of if 210
20 Lecture 6 Part 3 : More general form of conditions 216
21 Lecture 6 Part 4 : A somewhat large program example 225
22 Lecture 6 Part 5 : Switch statement and logical data 231
23 Lecture 7 Part 1 : Loops 243
24 Lecture 7 Part 2 : Mark averaging 251
25 Lecture 7 Part 3 : The break and continue statements 257
26 Lecture 7 Part 4 : The for statement 264
27 Lecture 7 Part 5 : Euclid's algorithm for GCD 279
28 Lecture 7 Part 6 : Correctness proof for GCD 290
, Week 4
29 Lecture 8 : Computing Mathematical Functions Part 1 : Taylor series 300
Lecture 8 : Computing Mathematical Functions Part 2 : Numerical
30 integration 313
31 Lecture 8 : Computing Mathematical Functions Part 3 : Bisection Method 322
Lecture 8 : Computing Mathematical Functions Part 4 : Newton Raphson
32 Method 332
Lecture 9 : Loops in various applications Part 1 : Loops in various
33 applications brute force algorithms 343
Lecture 9 : Loops in various applications Part 2 : Finding Pythagorean
34 Triples 350
Lecture 9 : Loops in various applications Part 3 : Modelling a system:
35 bargaining 361
36 Lecture 9 : Loops in various applications Part 4 : Simulating a water tank 367
Lecture 9 : Loops in various applications Part 5 : Arithmetic on very large
37 numbers 376
Week 5
38 Lecture 10 : Functions Part 1 : Basics 388
39 Lecture 10 : Functions Part 2 : Examples 403
40 Lecture 10 : Functions Part 3 : Reference parameters 414
41 Lecture 10 : Functions Part 4 : Pointers 421
42 Lecture 10 : Functions Part 5 : Graphics Objects and Lecture conclusion 431
43 Lecture 11 : Recursion Part 1 : Introduction 437
44 Lecture 11 : Recursion Part 2 : Recursive objects, Tree drawing 449
45 Lecture 11 : Recursion Part 3 : How to think about recursion 464
Week 6
46 Lecture 12 : Virahanka Numbers Part 1 : Introduction 478
47 Lecture 12 : Virahanka Numbers Part 2 : Recursive Program 484
48 Lecture 12 : Virahanka Numbers Part 3 : Iterative Program and Conclusion 495
49 Lecture 13 : Program Organization and Functions Part 1 : Introduction 501
50 Lecture 13 : Program Organization and Functions Part 2 : Splitting into files 511
51 Lecture 13 : Program Organization and Functions Part 3 : Namespaces 521
Lecture 13 : Program Organization and Functions Part 4 : How to use C++
52 without simplecpp 526
Lecture 14 : Advanced Features of Functions Part 1 : Introduction and
53 passing one function to another 532
54 Lecture 14 : Advanced Features of Functions Part 2 : Lambda expressions 543
, Lecture 14 : Advanced Features of Functions Part 3 : Default values to
55 parameters 553
Lecture 14 : Advanced Features of Functions Part 4 : Function overloading
56 and lecture conclusion 559
Week 7
57 Lecture 15 : Array Part-1 : Part 1 : Introduction 567
58 Lecture 15 : Array Part-1 : Part 2 : Marks averaging problem 576
59 Lecture 15 : Array Part-1 : Part 3 : Histogram computation 586
60 Lecture 15 : Array Part-1 : Part 4 : Marks display variation 594
61 Lecture 15 : Array Part-1 : Part 5 : Polynomial multiplication 608
62 Lecture 15 : Array Part-1 : Part 6 : Queues in dispatching taxis 614
Lecture 15 : Array Part-1 : Part 7 : More efficient Queues in dispatching
63 taxis 624
64 Lecture 15 : Array Part-1 : Part 8 : Disk intersection 634
Lecture 15 : Array Part-1 : Part 9 : Arrays of graphical objects and
65 conclusion 641
66 Lecture 16 : Array Part-2 : Part 1 : Introduction 649
67 Lecture 16 : Array Part-2 : Part 2 : Interpretation of aname[index] 656
68 Lecture 16 : Array Part-2 : Part 3 : Arrays and function calls 666
69 Lecture 16 : Array Part-2 : Part 4 : A function to sort an array 675
Week 8
70 Lecture 17 : More on Arrays : Part 1 : Textual data 696
71 Lecture 17 : More on Arrays : Part 2 : Functions on character strings 709
72 Lecture 17 : More on Arrays : Part 3 : Two dimensional arrays 721
73 Lecture 17 : More on Arrays : Part 4 : Command Line Arguments 742
74 Lecture 18 : Arrays and recursion : Part 1 : Binary Search Introduction 750
75 Lecture 18 : Arrays and recursion : Part 2 : Binary search analysis 770
76 Lecture 18 : Arrays and recursion : Part 3 : Mergesort overview 778
77 Lecture 18 : Arrays and recursion : Part 4 : Merge function 784
78 Lecture 18 : Arrays and recursion : Part 5 : Mergesort conclusion 791
Week 9
79 Lecture 19 : Structures : Part 1 : Definition and instantiation 800
80 Lecture 19 : Structures : Part 2 : Operations on structures 807
81 Lecture 19 : Structures : Part 3 : An example program 815
82 Lecture 19 : Structures : Part 4 : Pointers and lecture conclusion 826
83 Lecture 20 : Structures Part 2 : Part 1 : Introduction to Member functions 833
S. No Topic Page No.
Week 1
1 Lecture 1 Part 1: Introduction 1
2 Lecture 1 Part 2 : Introduction 13
3 Lecture 1 Part 3 : Introduction 21
4 Lecture 1 Part 4 : Introduction 34
5 Lecture 2 Part 1 : Problem Solving using Computer 50
6 Lecture 2 Part 2 : Problem Solving using Computer 63
7 Lecture 2 Part 3 : Problem Solving using Computer 70
8 Lecture 2 Part 4 : Problem Solving using Computer 87
9 Lecture 2 Part 5 : Problem Solving using Computer 98
Week 2
10 Lecture 3 Part 1 : Basic Elements of Program 108
11 Lecture 3 Part 2 : Basic Elements of Program 120
12 Lecture 3 Part 3 : Basic Elements of Program 134
13 Lecture 3 Part 4 : Basic Elements of Program 144
14 Lecture 4 Part 1 : Program Design 151
15 Lecture 4 Part 2 : Program Design 157
16 Lecture 4 Part 3 : Program Design 166
17 Lecture 5 : Simple cpp Graphics 180
Week 3
18 Lecture 6 Part 1 : Conditional Execution 199
19 Lecture 6 Part 2 : Most general form of if 210
20 Lecture 6 Part 3 : More general form of conditions 216
21 Lecture 6 Part 4 : A somewhat large program example 225
22 Lecture 6 Part 5 : Switch statement and logical data 231
23 Lecture 7 Part 1 : Loops 243
24 Lecture 7 Part 2 : Mark averaging 251
25 Lecture 7 Part 3 : The break and continue statements 257
26 Lecture 7 Part 4 : The for statement 264
27 Lecture 7 Part 5 : Euclid's algorithm for GCD 279
28 Lecture 7 Part 6 : Correctness proof for GCD 290
, Week 4
29 Lecture 8 : Computing Mathematical Functions Part 1 : Taylor series 300
Lecture 8 : Computing Mathematical Functions Part 2 : Numerical
30 integration 313
31 Lecture 8 : Computing Mathematical Functions Part 3 : Bisection Method 322
Lecture 8 : Computing Mathematical Functions Part 4 : Newton Raphson
32 Method 332
Lecture 9 : Loops in various applications Part 1 : Loops in various
33 applications brute force algorithms 343
Lecture 9 : Loops in various applications Part 2 : Finding Pythagorean
34 Triples 350
Lecture 9 : Loops in various applications Part 3 : Modelling a system:
35 bargaining 361
36 Lecture 9 : Loops in various applications Part 4 : Simulating a water tank 367
Lecture 9 : Loops in various applications Part 5 : Arithmetic on very large
37 numbers 376
Week 5
38 Lecture 10 : Functions Part 1 : Basics 388
39 Lecture 10 : Functions Part 2 : Examples 403
40 Lecture 10 : Functions Part 3 : Reference parameters 414
41 Lecture 10 : Functions Part 4 : Pointers 421
42 Lecture 10 : Functions Part 5 : Graphics Objects and Lecture conclusion 431
43 Lecture 11 : Recursion Part 1 : Introduction 437
44 Lecture 11 : Recursion Part 2 : Recursive objects, Tree drawing 449
45 Lecture 11 : Recursion Part 3 : How to think about recursion 464
Week 6
46 Lecture 12 : Virahanka Numbers Part 1 : Introduction 478
47 Lecture 12 : Virahanka Numbers Part 2 : Recursive Program 484
48 Lecture 12 : Virahanka Numbers Part 3 : Iterative Program and Conclusion 495
49 Lecture 13 : Program Organization and Functions Part 1 : Introduction 501
50 Lecture 13 : Program Organization and Functions Part 2 : Splitting into files 511
51 Lecture 13 : Program Organization and Functions Part 3 : Namespaces 521
Lecture 13 : Program Organization and Functions Part 4 : How to use C++
52 without simplecpp 526
Lecture 14 : Advanced Features of Functions Part 1 : Introduction and
53 passing one function to another 532
54 Lecture 14 : Advanced Features of Functions Part 2 : Lambda expressions 543
, Lecture 14 : Advanced Features of Functions Part 3 : Default values to
55 parameters 553
Lecture 14 : Advanced Features of Functions Part 4 : Function overloading
56 and lecture conclusion 559
Week 7
57 Lecture 15 : Array Part-1 : Part 1 : Introduction 567
58 Lecture 15 : Array Part-1 : Part 2 : Marks averaging problem 576
59 Lecture 15 : Array Part-1 : Part 3 : Histogram computation 586
60 Lecture 15 : Array Part-1 : Part 4 : Marks display variation 594
61 Lecture 15 : Array Part-1 : Part 5 : Polynomial multiplication 608
62 Lecture 15 : Array Part-1 : Part 6 : Queues in dispatching taxis 614
Lecture 15 : Array Part-1 : Part 7 : More efficient Queues in dispatching
63 taxis 624
64 Lecture 15 : Array Part-1 : Part 8 : Disk intersection 634
Lecture 15 : Array Part-1 : Part 9 : Arrays of graphical objects and
65 conclusion 641
66 Lecture 16 : Array Part-2 : Part 1 : Introduction 649
67 Lecture 16 : Array Part-2 : Part 2 : Interpretation of aname[index] 656
68 Lecture 16 : Array Part-2 : Part 3 : Arrays and function calls 666
69 Lecture 16 : Array Part-2 : Part 4 : A function to sort an array 675
Week 8
70 Lecture 17 : More on Arrays : Part 1 : Textual data 696
71 Lecture 17 : More on Arrays : Part 2 : Functions on character strings 709
72 Lecture 17 : More on Arrays : Part 3 : Two dimensional arrays 721
73 Lecture 17 : More on Arrays : Part 4 : Command Line Arguments 742
74 Lecture 18 : Arrays and recursion : Part 1 : Binary Search Introduction 750
75 Lecture 18 : Arrays and recursion : Part 2 : Binary search analysis 770
76 Lecture 18 : Arrays and recursion : Part 3 : Mergesort overview 778
77 Lecture 18 : Arrays and recursion : Part 4 : Merge function 784
78 Lecture 18 : Arrays and recursion : Part 5 : Mergesort conclusion 791
Week 9
79 Lecture 19 : Structures : Part 1 : Definition and instantiation 800
80 Lecture 19 : Structures : Part 2 : Operations on structures 807
81 Lecture 19 : Structures : Part 3 : An example program 815
82 Lecture 19 : Structures : Part 4 : Pointers and lecture conclusion 826
83 Lecture 20 : Structures Part 2 : Part 1 : Introduction to Member functions 833