KTU S1

Algorithmic Thinking with Python

UCEST105 · 4.0 credits · 42 topics · official syllabus ↗

Module 1: Problem-Solving Strategies, the Problem-Solving Process, and Python Essentials · 7 hrs

Module 1 does two jobs at once. The first half is about how people solve problems — the named strategies (trial and error, heuristics, means-ends analysis, working backward) and the disciplined seven-step process that turns a vague real-world problem into a working program. The second half starts Python: variables, numeric and string types, the math module, basic input and output, and operator precedence. The two halves connect. The strategies tell you what to think; Python is where you write the answer down. Students who skip the first half tend to start typing code before they understand the problem, which is the single most common cause of losing marks in the lab exam.

Problem-Solving Strategies Defined
Easy · ~20 min
→
Trial and Error
Easy · ~20 min
→
Heuristics
Medium · ~22 min
→
Means-Ends Analysis
Medium · ~25 min
→
Backtracking (Working Backward)
Medium · ~25 min
→
The Computer as a Model of Computation
Medium · ~25 min
→
Understanding the Problem
Medium · ~22 min
→
Formulating a Model
Medium · ~25 min
→
Developing an Algorithm
Medium · ~28 min
→
Writing, Testing and Evaluating the Program
Medium · ~28 min
→
Variables and Data Types in Python
Easy · ~30 min
→
The math Module and Basic Input/Output
Easy · ~28 min
→
Python Operators and Their Precedence
Medium · ~30 min
→

Module 2: Algorithm and Pseudocode Representation, and Flowcharts · 9 hrs

Module 2 gives you two ways to write down an algorithm before you write code: pseudocode (structured text) and flowcharts (diagrams). Both express the same three constructs — sequence, selection, repetition — which between them are sufficient to express any algorithm. The module is heavily exercise-driven. The syllabus lists nine specific sample problems, and every one of them appears in past papers in some form. Work them by hand; the marks in Part B come from being able to produce correct pseudocode under time pressure, not from recognising it. Flowcharts here are used only for visualising control flow. The syllabus suggests the RAPTOR tool for drawing and running them.

What Pseudocode Is, and Why We Use It
Easy · ~22 min
→
Sequencing
Easy · ~18 min
→
Selection — the if-else Structure
Medium · ~28 min
→
Selection — the Case Structure
Medium · ~25 min
→
Repetition — the FOR Loop
Medium · ~25 min
→
Repetition — the WHILE Loop
Medium · ~25 min
→
Repetition — the REPEAT-UNTIL Loop
Medium · ~25 min
→
Flowchart Symbols
Easy · ~25 min
→
Drawing Flowcharts for Selection and Loops
Hard · ~30 min
→
Case Study: Determining a Grade on the KTU Scale
Hard · ~35 min
→

Module 3: Selection and Iteration in Python, Sequence Types, Modularisation and Recursion · 10 hrs

Module 3 is where the course turns from describing algorithms to running them. Everything Module 2 expressed as pseudocode now becomes real Python: if/elif/else, for with range, and while. Then come the sequence types — list, tuple, set, string, dictionary, and NumPy arrays — which is the single biggest jump in the semester. Choosing the right one is a modelling decision, not a syntax decision, and picking wrongly makes a problem far harder than it needs to be. The module closes with decomposition, functions, and recursion. Recursion is the topic S1 students most often say "clicked" only on the second pass, so the notes spend real time on the call stack rather than treating it as an implementation detail.

Selection in Python — if, elif, else
Easy · ~25 min
→
The for Loop and range()
Medium · ~28 min
→
The while Loop in Python
Medium · ~25 min
→
Lists
Medium · ~30 min
→
Tuples and Sets
Medium · ~26 min
→
Strings as Sequences
Medium · ~26 min
→
Dictionaries
Medium · ~28 min
→
Arrays with NumPy
Medium · ~26 min
→
Decomposition and Modularisation
Medium · ~28 min
→
Defining and Using Functions in Python
Medium · ~30 min
→
Functions with Multiple Return Values
Medium · ~22 min
→
Recursion and the Call Stack
Hard · ~35 min
→
Recursion: The Standard Problems
Hard · ~32 min
→

Module 4: Computational Approaches to Problem Solving · 10 hrs

Module 4 returns to Module 1's question — which strategy does this problem call for? — but now with real algorithms behind each answer. Five approaches: brute force tries everything, divide-and-conquer splits the problem, dynamic programming remembers sub-answers, greedy takes the best-looking step each time, and randomised uses chance deliberately. The syllabus is explicit that this is "introductory diagrammatic and algorithmic explanations only — analysis not required". So the notes build intuition for when each approach fits and what it costs, using counted operations and worked traces rather than formal complexity notation. The recursion-versus-dynamic-programming comparison uses Fibonacci, which Module 3 already measured: the naive recursion needs 2,692,537 calls for fib(30). That number is the argument.

The Brute-Force Approach
Easy · ~25 min
→
The Divide-and-Conquer Approach
Medium · ~30 min
→
The Dynamic Programming Approach
Hard · ~32 min
→
The Greedy Algorithm Approach
Hard · ~32 min
→
The Randomized Approach
Hard · ~32 min
→
Choosing an Approach
Hard · ~30 min
→