Algorithms Flashcards
Which are the 3 computational thinking principles?
- decomposition
- abstraction
- algorithmic thinking
Abstraction
The process of removing unnecessary details and only including relevant details
Abstraction examples
- flowcharts
- variables in program
Decomposition
Breaking down complex problem down into smaller problems and solving each one individually
Advantages of decomposition
- 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
algorithmic thinking
- 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
syntax error
errors which break the grammatical rules of programming language
- stop from program from running
Logic error
Produce an unexpected output but wont stop the program from running
An advantage of using trace tables
Excellent way to track down logic errors in the program
Binary search properties
- requires data to be ordered
- more efficient than linear search
Linear search properties
- 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
bubble sort
- most insufficient of sorting algorithms
- easy to implement
- made for small data sets
merge sort
- works well for large data sets
- very efficient method of sorting
What are the 5 data types?
- integer
- float
- boolean
- character
- string
casting
converting a variable from one data type to another