Topic 1 Computational Thinking

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

Definition of Decomposition

The process of breaking a problem down into smaller parts.

2
New cards

Benefits of decomposition

  • It is often easier to solve several small problems than one big problem.

  • Different modules(parts) of the program can be worked on by different developers simultaneously, which speeds up the development process

  • Different modules can be tested independently, ensuring that they work before they come together to form the whole solution. This means that when they are joined, there are fewer errors.

3
New cards

Abstraction

Removing unnecessary details and focusing on the important ones in order to make the problem simpler.

4
New cards

Examples of Abstraction

  • Subprograms: by giving a block of a code a name it abstracts the complexity of it. The user does not have to understand how it works and just has to call it.

  • Operating systems

5
New cards

Count-controlled loop

A loop that runs for a definite amount of time

6
New cards

Count-controlled loop

A loop that runs while a condition is true

7
New cards

Variable

A named location in memory that stores a value that can be changed as the program runs

8
New cards

Constant

A named location in memory that cannot be changed as the program runs

9
New cards

Integer

Any whole number, positive or negative

10
New cards

Float/Real

Any number with a fractional or decimal part

11
New cards

String

A collection of alphanumeric characters. In code strings are identified by quotation marks.

12
New cards

Character

A single alphanumeric character or symbol

13
New cards

Boolean

a True or False value

14
New cards

Casting

The process of converting from one data type to another

15
New cards

Array

A data structure that stores multiple elements of the same data type under the same identifier

16
New cards

Record

A data structure that stores multiple elements of different data types under the same identifier

17
New cards

Arithmetic operators

Addition : +

Substraction: -

Multiplication: *

Division : /

Integer division(DIV): //

Modulus(MOD, returns the remainder): %

18
New cards

Relational operators

=, !=, >, <, >=, <=

19
New cards

Logical operators

AND (returns true when both conditions are true)

OR (returns true when either of the conditions is true)

NOT (Reverses the outcome of the expression)

20
New cards

Trace tables

used to determine what value a variable will hold at a given point in an algorithm

  • go to the next line when a variable changes value

21
New cards

Syntax error

An error that breaks the grammatical rules of the programming language and stops the program from running, such as a typo, spelling mistakes, missing bracket or quotation marks,..

22
New cards

Runtime error

An error that causes the program to crash as the operation that the computer is asked to do is impossible, such as dividing by 0 or an index that’s out of range

23
New cards

Logical error

An error where incorrect code is used, causing the program to produce incorrect output. The program will still run.

Example : incorrect use of index, wrong relational operator, …etc.

24
New cards

Linear search

Linear search is the simplest way to find an item in a list.

You start at the first item and check each item one by one until:

  • you find the target → return its position, or

  • you reach the end of the list → the item is not there.

It works on any list — it does not need to be sorted.

25
New cards

Binary search

Binary search is a fast way to find an item in a sorted list.

It works by repeatedly cutting the list in half:

  1. Look at the middle item.

  2. If it is the target → found.

  3. If the target is smaller, search the left half.

  4. If the target is bigger, search the right half.

  5. Repeat until found — or until nothing is left.

Because it halves the list each time, it is much faster than linear search.