Poland Liceum ogólnokształcące, klasa III Computer science (extended level)
Chapters: 1
1. Designing and programming algorithms (I + II)
Algorithms to implement · Problems to solve · Techniques and data structures
- Search Algorithms in AI: Finding the Way Step by Step – Many AI problems are about finding a way from a start to a goal: a route on a map, a puzzle solution or a good move in a game. We describe the problem as a state space: states (situations) joined by actions (moves). A search algorithm explores this space in a fixed order. Blind (uninformed) search like breadth-first and depth-first search knows nothing about where the goal is. Informed search uses a heuristic, a smart guess of how far the goal is, so it opens far fewer states. A* adds the cost so far (g) to the guess (h) and, with a heuristic that never over-guesses, still finds the shortest path.
- Introduction to Problem Solving – Problem solving on a computer has stages: analyse the problem (inputs, outputs, rules), develop an algorithm (a finite, clear, ordered set of steps), code it in a programming language, test it with different inputs, and debug (find and remove errors). An algorithm can be shown as a flowchart (oval = start/stop, parallelogram = input/output, rectangle = process, diamond = decision, arrows = flow) or as pseudocode (structured plain English). Decomposition breaks a big problem into smaller sub-problems that are solved separately and then joined.
- Data Structures: Arrays, Lists, Stacks, Queues and Trees – A data structure is a way of organising data in memory so a program can use it well. Arrays keep items in numbered boxes for instant access by index. Linked lists chain nodes with pointers, so inserting is easy. Stacks work last-in-first-out, queues first-in-first-out. Dictionaries find values by key, and trees store data in levels so searching is fast. Choosing the right structure makes programs faster and simpler.