Algorithms Flashcards

1
Q

Which are the 3 computational thinking principles?

A
  • decomposition
  • abstraction
  • algorithmic thinking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Abstraction

A

The process of removing unnecessary details and only including relevant details

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Abstraction examples

A
  • flowcharts
  • variables in program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Decomposition

A

Breaking down complex problem down into smaller problems and solving each one individually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantages of decomposition

A
  • problems easier to solve
  • different people can work on different
    parts of a problem at the same time
  • reduces development time
  • program components developed in
    one program can easily be used in
    other programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

algorithmic thinking

A
  • a logical way of getting from the
    problem to the solution
  • by creating a set of rules, an algorithm
    that is followed precisely leads to an
    answer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

syntax error

A

errors which break the grammatical rules of programming language
- stop from program from running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Logic error

A

Produce an unexpected output but wont stop the program from running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

An advantage of using trace tables

A

Excellent way to track down logic errors in the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Binary search properties

A
  • requires data to be ordered
  • more efficient than linear search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Linear search properties

A
  • doesn’t require data set to be in order
  • work on any type of storage devices
  • can be efficient for smaller data sets
  • inefficient for large data sets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

bubble sort

A
  • most insufficient of sorting algorithms
  • easy to implement
  • made for small data sets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

merge sort

A
  • works well for large data sets
  • very efficient method of sorting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 5 data types?

A
  • integer
  • float
  • boolean
  • character
  • string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

casting

A

converting a variable from one data type to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Assignment

A

giving a variable or constant a value

17
Q

difference between a constant and a variable?

A

variable = stored in memory
constant = assigned when the program
is designed

variable= value that can change while
constant = value doesn’t change

18
Q

Advantages of constants

A
  • make program easier to read
  • can be easily changed in one place in a
    program = less chance of errors
  • compiler can optimise the code
  • makes the program run more quickly
19
Q
A