Topic 4: Computational Thinking Flashcards
Computer program
Sequence of instructions, written to insctruct a computer to perform a specified task.
Stages of problem solving
Identification
Development
Selection
Implementation
Properties of algorythms
Finiteness
Definiteness
Input/Output
Effectiveness
Ways of expressing algorithms
Simple English
Flowcharts
Pseudocode
Programming Language
Subprocedures
Break the problem in pieces and then attack every piece instead of solving a big complex problem. It contains a series of commands that perform a task. It is also called modular programming.
Iteration
Process of repeating a series of instructions. Is used to repeat a statement or a block of statements within an algorithm.
Conditional statement
Perform different instructions depending on a Boolean test. This Boolean is evaluated and depends on if it is true or false the program does one thing or another. The if-then-else conditional statement is common across programming languages.
Inpu/Output
An input is something that is put into a program while output is something that is produced by the program after a process.
Pre-planning
Process of planning something in advance.
Ghantt Chart
Type of bar chart that is widely used for project schedules and project management.
On the left, there is a list of the tasks, activities and events. Along the top there is the time scale. Each bar represents the time spent in one task.
Complexities of searches and sorts
Binary O (Log n) Sequential O(n) Bubble O(n^2) Slection O(n^2)
Compiler
- Compiler transforms code written in a high-level programming language into the machine code, at once, before program runs
- Faster
Interpreter
- Interpreter coverts each high-level program statement, one by one, into the machine code, during program run.
- Slower
Fundamental operations
Operations that don’t require the processor to go through a large number of operations to reach a result f.e. add, retrieve, compare, store
Compound operations
More complex operations which involve a number of stages with operations such as finding the largest number in an array.
Array
- Fixed in size
- Holds same type data only
Collection
- Growable
- Can hold same and different type data
Advantages of sub-programs
- Can speed up the process because braking down a complex program means small pieces can be donde simultaneously.
- It enables reusing code accross multiple programs.
- Facilitates abstraction
- Improves maintainance and makes easier testing.
Advantages of using collections
Collections are predefined algorithms that prorammers can use immediately.
- Increases performance
- Code reuse, saves time and money
-
What’s abstraction and why should we use it?
Allows to create a general of what the problem looks and how to solve it.
- Removes all specific details so it helps forming a model.
- If it’s not used, designers may end up with the wrong solution.
- Widely used because there are several common patterns in programming.
- It’s one of the principles of OOP.