Component 2 Flashcards
What are the principles of computational thinking?
Abstraction, decomposition and algorithmic thinking
What is computational thinking
Taking a problem then braking it down into smaller more managable problems, solving it, then putting them back into order to solve the large problem
what is abstraction, decomposition and algorithmic thinking and why it is important
-Abstraction: The filtering of unwanted/useless information that is irrelevant to solving the problem. This allows the problem to be simplified so that the user can focus on the important and main parts
-Decomposition: The braking down of a large problem into smaller more managable ones so that the overall complicated problem becomes simplified and easier to solve
-Algorithmic thinking: Deciding on the order in which the smaller solved problems Iinstructions) should be carried out and put together. As well as identifiing the steps that the computer needs to do
what is a structure diagram
a form of top to bottom design that helps us to decompose a problem. Each level answers: what is invoilved in the above step
what is a flow chart and its adv and limitation?
A diagram that visually shows an overview of a program. It is represented by symbols that represent different types of instructions.
Advantages:
-easy to see the overview and process of the program and to see what should happen.
International standard
Disadvantages:
-with a large program, flow charts may be hard to follow and may start becomming confusing
- ay changes to the design may cause large parts of the chart to be redrawn and this is time conduming
what is pseudocode
it is a way/used to write algorithms in a program style construct but is not an official programming language (Meaning that there are no correct ways and no worry about syntax errors)
What is a trace table?
It is a table to show how a variable changes throughout the program as the program is run.
Why is trace table useful?
it allows us to see weather a program is running as it should
what are the standard searching algorithms?
binary, linear
what is binary search and how is it carried out?
Binary search is a process where the program finds the midpoint of teh data set and compares the value with the goal value. Then it proceeds to see weather it should cut off the top half or the bottom half. This repeats continuously until te goal value is found.
what is a search algorithm?
set of instructions for finding a specific piece of data witin a data set
What are the limitations and advantages of binary search?
limit: It only works on sorted data
adv: It can be very efficient for large data sets
what is linear search
linear search is a process where the program compares the first item in the list and compares it to the goal value if it does not match then it moves to the next one.
what are the advantages and limitations of linear search?
adv: It works on unsorted data sets
limit: It can be time conusiming and ineffficient with large data set
what is a sorting algorithm?
a sorting algorithm is a set of instructions to arrange a list of data into a specific order. Usually from low to high.
What are the types of sort algorithms?
merge, insertion and bubble
what is merge sort?
uses a technique called divide and conque where the list repeatedly divides into 2 from the idpoint until all elements are separated individually. They are then put back together in order.
Adv and limitations of merge sort
Adv:
very efficient and the steps do not really increas even if the data grows
Limitations:
uses more memory
whole algorithm will run even if the data is sorted
will be quite slow for small data lists
What is insertion sort
it is a sorting algorithm in which it starts from the second value and compares it with the value on the right. This alows the value to be put into the correct space straight away.
Adv and limitations of insertion sort
Adv:
simple and little memory is used becasue the sorting is done on the original list
can quickly check weather a list is sorted
Limitation: does not cope well with large lists
what is bubble sort
it starts from the first valume in the list then compares it with the value on the right and makes the required adjustment. It does not put the value in the correct place instantly like insertion sort does. The bubble sort continues until it makes a pass without any values being swapped.
Adv and limitations of bubble sort
Adv:
It can be useful to check weather a list is sorted
Little memory used as only one value is sorted at a time
Limitations:
Time consuming as only one value is sorted
What is each run through of a data from start to finish called?
Pass
what are variables?
They are named locations in memory that are used to store temporary values that can change as the program is running.
what is the name of a variable called?
Identifier
what are variables used to store
A single piece of data
what does declaring a variable mean?
stating the variables name and the type of data that it will contain
what is assignment?
to assigna variable a value
What are constants?
basically variables but just that their assigned value does not change throughout the run of the program.
why are constants used?
can be useful for values which do not change that you do not want tot repeatedly type into the program. This means that teh code will be much clearer and easier to edit when you want to change the value as you just need to change where you assigned the value and do not need to look through the whole program.