100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary Computer Science Paper 2 Revision Notes $4.03   Add to cart

Summary

Summary Computer Science Paper 2 Revision Notes

 40 views  0 purchase
  • Course
  • Institution

Computer Science OCR GCSE Paper 2 Revision Notes - 4 pages of notes

Preview 2 out of 5  pages

  • February 18, 2022
  • 5
  • 2021/2022
  • Summary
  • 200
avatar-seller
COMPUTATIONAL THINKING: FLOWCHARTS:
Computational thinking is about the steps that you Rounded rectangle - start/stop
take in order to nd the best solution to a complex Parallelogram - inputs/outputs
problem. Rectangle - process
The three key techniques for computational thinking Diamond - decision
are: Rectangle with lines - sub program
• Decomposition - breaking down a problem into a Arrow - direction of ow in a owchart
series of smaller sub-problems and solving each one Flowcharts can show sequences, selections and
individually iterations, or a combination of multiple of them. These
• Abstraction - removing any irrelevant parts of a are:
problem to focus on the important parts Sequences - one way to get from the start to the end
• Algorithmic thinking - alogical way of getting from Selection - multiple ways to get to the end
a problem to the solution. If the steps you take to Iteration - a loop that allows you to repeat a task
solve a problem follow an algorithm, then they can
be reused and adapted to solve similar problems in




SEARCH ALGORITHMS: BUBBLE SORT:
Binary Search - nd the middle value, if it’s that then 1. Compare the rst 2 numbers and swap them
stop. If not, compare your desired value with the around if they are in the wrong order
actual value. If the actual value is greater then split the 2. Move on to the next pair and do the same thing
numbers on the left and repeat.if its smaller then go to 3. Repeat until you get to the end of the list (this is a
the right and repeat. pass)
Linear Search - go through the list 1 by 1 and 4. Repeat until there are no swaps in a pass
compare your desired value with the actual value, until Advantages:
you have found the desired value. • simple and easily implemented
Comparisons; • e cient way to check if a list is already ordered
Linear searches are simpler, but not as e cient. • doesn’t use a lot of memory
A linear search doesn’t have to be on an ordered list, Disadvantages:
but a binary search does. A linear search is therefore • Ine cient when sorting a list
only used on smaller lists. Therefore, a binary search • Doesn’t cope well with a large list
is more e cient on a sorted list.



MERGE SORT: INSERTION SORT:
1. Split the list in half into two sub-lists 1. Look at the second item in a list
2. Repeat step 1 until the lists only contain 1 item 2. Compare it to all the items before it and insert into
3. Merge pairs of sub-lists so that each one has twice the right place
as may items. Each time you merge, merge them in 3. Repeat until the last number in the list has been
order. inserted into the correct place
4. Repeat until fully merged Advantages:
Advantages: • Easily coded
• More e cient and quicker for a larger list • Intuitive
• Consistent running times • Copes well with small lists
Disadvantages; • Doesn’t require much additional memory
• Slow for small lists • Very quick to order new items once ordered
• Even if its already sorted, it will still go through the • very quick at checking that a list is sorted
whole process Disadvantages:
• Uses more memory • It doesn’t cope very well with a large list




fifi
fi

, DATA TYPES: OPERATORS:
Programming languages have ve main data types, Operators are special characters that perform certain
which are integer, real (or oat), boolean, character functions.
and string • They take two values and perform a maths function
Each data type stores a di erent amount of memory • You can add, subtract, multiply and divide
• Using the correct data type makes the code more • You can also use exponentials to calculate powers
e cient, robust and predictable • The DIV operator can be used to return the whole
Casting can be used to change the data type number of a division
Most high-level languages have functions that allow • The MOD operator can be used to return the
you to manually convert between di erent data types: remainder from a division
• int(), real(), bool() and str() • The operators all work on integers and real data
• You can also use the ASC() and CHR() functions to values and follow the rules of BIDMAS
convert between ASCII and characters • Comparison operators produce a boolean value
(e.g. == and <>)
• The assignment operator ‘=‘ assigns values



CONSTANTS, VARIABLES & STRINGS: PROGRAM FLOW:
Data values can be stored as constants or variables. The ow of a program is the order that the steps are
A constant is assigned a data value that can’t be carried out in. The program ow can be controlled by
changed using selection statements. These include IF and
A variable can change value, making it more useful SWITCH statements.
Strings are written inside quotation marks (usually
double “”, but can be single ‘’) IF statements usually have an IF-THEN-ELSE
• Strings can be joined together to form a new string structure e.g. owchart. However, they can be a
(concatenation) nested IF statement, where an IF statement is put
• This is done using the + operator into another IF statement
Programs let you manipulate strings in a variety of SWITCH statements check the value of a variable
di erent ways e.g. all upper characters, all lower instead of whether it is true or false. They are similar
characters, return the length, extract a single character to IF-ELSEIF, but are easier to maintain as they are
for a certain position, extract a string from within it set out in a neater way.
• Always remember that strings start at 0



PROGRAM FLOW: BOOLEAN LOGIC:
FOR Loops are a count-controlled loop, meaning that NOT, AND and OR logic gates
they will repeat the code that is inside of them for a • Multiple logic gates can be combined to form more
xed number of times. complex operations
You can also have condition-controlled loops • The truth tables can be worked out by working
• These include DO UNTIL and WHILE through each gate in order
DO UNTIL Loop: • Logic circuits can therefore have more than two
• controlled by a condition at the end of the loop inputs
• keep going until the condition is true • Boolean operators are carried out in the order:
• always run the code at least once brackets, NOT, AND then OR
• you can get in nite loops if condition is never true • Boolean operators can be used in conditions to
WHILE Loop: make all the di erent selection statements and
• controlled by a condition at the start of the loop iteration statements more e cient and more
• keeps going while the condition is true versatile
• never run the code if initially false
• you can get in nite loops if condition is always true




fl fi

flfl

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller lucyannehayden. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.03. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76800 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$4.03
  • (0)
  Add to cart