MC102 - Computer Algorithms and Programming
This page contains links to slides and videos from MC102 - Algorithms and Computer Programming.
Slides change over time and the link is always to the latest version. Therefore, the slides shown in the videos may not match the actual slides. Also, depending on the semester, the order of some classes may change in relation to the order of videos on YouTube. The site will be maintained in the order that the classes will be taught in the respective semester.
There are also some CodeForces issues with training the content. Problems marked with one or more ⭐ are more interesting than others… But more interesting doesn't necessarily mean harder.
Corrections in links and suggestions for other content, mainly CodeForces problems, are more than welcome!
Index
- classrooms
- Unit 01 - About the Discipline
- Unit 02 - History of Computing
- Unit 03 - Introduction
- Unit 04 - Variables
- Unit 05 - Conditionals
- Unit 06 - Repetition
- Unit 07 - Functions
- Unit 08 - Good Code
- Unit 09 - Lists and Strings
- Unit 10 - Dictionaries and Sets
- Unit 11 - Arrays and Multidimensional Objects
- Unit 12 - Combining and Using Data Structures
- Unit 13 - Classes and Objects
- Unit 14 - Archives
- Unit 15 - Search and Sorting Algorithms
- Unit 16 - Recursion
- Unit 17 - Recursive Sorting Algorithms
- Python Installation Guides
- Development Environments
- Suggested Extensions for Visual Studio Code
- YouTube Channel Suggestion
- Other courses
- Competitive Programming
classrooms
Unit 01 - About the Discipline
Unit 02 - History of Computing
Unit 03 - Introduction
Unit 04 - Variables
- Slides (handout)
- Video (2021)
- Exercises solved in class
- Why Computers are Bad at Algebra - Infinite Series
Unit 05 - Conditionals
- Slides (handout)
- Video (2021): Step 1 —, Step 2 —
- Exercises solved in class: Step 1 —, Step 2 —
- Inline If in Python: The Ternary Operator in Python
- Suggested issues in CodeForces: ⭐⭐ 318 / A, ⭐ 479 / A, ⭐ 4 / A, ⭐ 50 / A, 1 / A, 546 / A, 617 / A, 228 / A, 581 / A
Unit 06 - Repetition
- Slides (handout)
- Exercise list
- Video (2021): Step 1 —, Step 2 —, Step 3 —
- Exercises solved in class: Step 1 —, Step 2 —
- Python “while” Loops (Indefinite Iteration)
- Python “for” Loops (Definite Iteration)
- Python break and continue
- Suggested issues in CodeForces: ⭐⭐ 158 / B, ⭐ 158 / A, ⭐ 263 / A (Can you do it without using matrices?), ⭐ 96 / A, ⭐ 977 / A, ⭐ 110 / A, ⭐ 122 / A, ⭐ 344 / A, ⭐ 580 / A, ⭐ 1328 / A, ⭐ 268 / A, ⭐ 996 / A, 1335 / A, 791 / A, 231 / A, 69 / A, 116 / A, 271 / A, 677 / A, 467 / A, 136 / A, 1030 / A, 486 / A, 200 / B, 469 / A, 148 / A,
Unit 07 - Functions
- Slides (handout)
- Exercises solved in class: Step 1 —, Step 2 —, Step 3 —
- Exercise list
- Video (2021): Step 1 —, Step 2 —, Step 3 —, Step 4 —
- Positional-only and keyword-only arguments in Python
- You should put this in all your Python scripts
- Defining Your Own Python Function
- map
- reduced
- filter
Unit 08 - Good Code
Unit 09 - Lists and Strings
- Slides (handout)
- Exercises solved in class: Step 1 —, Step 2 —
- Exercise list
- Video (2021): Step 1 —, Step 2 —
- Python f-strings can do more than you thought
- Lists and Tuples in Python
- Strings and Character Data in Python
- Suggested issues in CodeForces: ⭐ 266 / A (the second test output should be 3 not 4), ⭐ 112 / A, ⭐ 59 / A, ⭐ 58 / A, ⭐ 41 / A, ⭐ 208 / A, ⭐ 443 / A, 734 / A, 133 / A, 71 / A, 282 / A, 118 / A, 281 / A, 61 / A, 705 / A, 131 / A, 25 / A, 520 / A
Unit 10 - Dictionaries and Sets
- Slides (handout)
- Exercises solved in class
- Exercise list
- Video (2021): Step 1 —, Step 2 —
- Dictionaries in Python
- Sets in Python
Unit 11 - Arrays and Multidimensional Objects
Unit 12 - Combining and Using Data Structures
- Slides (handout)
- Exercise list
- Exercises solved in class
- Video (2021)
- Documentation: function zip, function listed, library itertools
- Geeks for Geeks - Python Itertools
- Lists and Tuples in Python
- Working With JSON Data in Python
Unit 13 - Classes and Objects
- Slides (handout)
- Exercise list
- Exercises solved in class
- Video (2021)
- Python dataclasses will save you HOURS, also featuring attrs
- Python staticmethod and classmethod
- Magic Methods - Making Python builtins work with your classes
- Object-Oriented Programming (OOP) in Python 3
- Data Classes in Python 3.7+ (Guide)
Unit 14 - Archives
- Slides (handout)
- Exercises solved in class
- Video (2021): Step 1 —, Step 2 —
- Working With Files in Python
Unit 15 - Search and Sorting Algorithms
- Slides (handout)
- Video (2021): Step 1 —, Step 2 —
- Exercises solved in class
- Binary Search - A Different Perspective
- Sorting Algorithms in Python
- How to Do a Binary Search in Python
Unit 16 - Recursion
- Slides (handout)
- Video (2021): Step 1 —, Step 2 —, Step 3 —
- Exercises solved in class
- Recursion in Python: An Introduction
Unit 17 - Recursive Sorting Algorithms
- Slides (handout)
- Video (2021)
- Sorting Algorithms in Python
- Suggested issues in CodeForces: 339 / A, ⭐ 144 / A
Python Installation Guides
Development Environments
- Visual Studio Code RECOMMENDED!!!
- PyCharm
- REPL: Python in the Browser
- cloud shell editor
Suggested Extensions for Visual Studio Code
These are some extensions that I think are useful for people who are programming in Python or who improve the use of Visual Studio Code.
Basic:
Other extensions for Python:
Ways to see code execution in Python:
Overall improvements to VS Code:
Topic:
YouTube Channel Suggestion
Other courses
- learnpython.org
- Python Tutorial for Beginners: Learn Programming Basics
- Python Programming Examples
- The Python Tutorial