Paper 2 Flashcards
(39 cards)
What is an algorithm?
An algorithm can be described as “A set of steps that show how to perform a task or reach a goal”.
What is Binary search?
Binary search is an efficient algorithm for finding an item from a sorted list of items.
How does Binary search work?
It works by repeatedly dividing in half the portion of the list that could contain the item, until you’ve narrowed down the possible locations to just one.
What is linear search?
A linear search is the simplest method of searching a data set. Starting at the beginning of the data set, each item of data is examined until a match is made. Once the item is found, the search ends. If there is no match, the algorithm must deal with this.
What are the types of translators in computer?
Compiler
Interpreter
Assembler
What is the compiler?
A compiler translates a high-level language into machine code
What is the interpreter?
An interpreter is another type of program that translates a high-level language into machine code
What is the assembler?
An assembler translates assembly language into machine code. Assembly language is a low-level language written in mnemonics that closely reflects the operations of the CPU .
What are 2D arrays?
A two-dimensional array is similar to a one-dimensional array, but it can be visualised as a grid (or table) with rows and columns. Positions in a two dimensional array are referenced like a map using horizontal and vertical reference numbers. They are sometimes called matrices.
Examples of High-level Programming languages:
Python, Visual Basic, C#, Java, C++, PHP, Delphi, Logo
Examples of Query languages:
SQL
Examples of Markup languages:
HTML, XML
Examples of Low-level Programming languages:
Assembly language
What does Assembly language do?
Assembly language allows a programmer to create programs more easily than writing in machine code
What does Assembly language have to do?
Translate into machine code before can be executed
Describe High-level languages
High level languages generally have statements that look a bit like English or Maths
This makes these languages easier to learn and understand
What have many high-level languages been designed to do?
To make it as easy as possible to write programs to solve certain types of problems
Advantages of High-level languages:
A high-level language is easier to learn
Programs can be written faster on a high-level language
It is easier to understand and debug a high-level language
Advantages of Low-level languages:
A program written in a low-level language can run very quickly
The code will usually require less RAM
Statements in a low-level language can be used to control and manipulate specific hardware components
What is source code?
The code written by the programmer
What is object code?
The code produced by the compiler
What are the differences between compiler and interpreter?
Compiler translates the whole program to produce object code, Interpreter translates and executes one line at a time
A compiled program executes faster as it is already inmacbine code, Interpreter take more time to execute as each instruction is translates before it is executed
What are the three Boolean Functions?
AND
OR
NOT
What is a syntax error?
A syntax error is one where the code written doesn’t conform to the rules of the language