Flashcards
Topic 1 - computing - algorithms
Flashcards do conjunto (11)
- 1What is an algorithmA set of steps that state how a task is performed. It has input data therefore output data is expected
- 2what are the 2 types of computer algorithms?Serial-each step or operation carried out in a linear order
Parallel-a number of operations run parallel to each other - 3what are the fundamental control structures/ constructs of every algorithm?SEQUENCE-linear progression, where one task is performed sequentially to the other
SELECTION-if-then- else ; a choice between 2 alternative courses
ITERATION-while loop- simple conditional test (at the beginning) - 4Even though the fundamental constructs are enough, what are some additional constructs?REPEAT/UNTIL- another loop, simple conditional test (at the end)
CASE- decision based on the value of the expression
FOR- counting loop - 5What are the three ways of representing constructs?pseudocode
Flow charts
Code - 6What is pseudocode?Consists of natural like language, which precisely describe
- 7What are the three types of errors that programmers encounter when writing a code?hvhjk
- 8mhbkhbbubble sorts requires an unsorted list. The sort will then start from the first number and compare it to the adjacent number, if the number on the left is greater than the one on the right, they get swapped. This process is repeated till you reach the end of the list. If the list is still incomplete, then the sort will call it the first pass and start all the way from the beginning. This process is repeated many times, adding the passes until the list is completely sorted. The sort will also do one final check called the check pass
- 9What is a quick sortA quick sort is a sort that organises a list of unordered number in order. The sort selects one number at random preferably the middle number and calls that the pivot it the takes each number and compares it to the pivot. if its greater than it goes to the right and lf its less than , it goes to the left. you then end up with two new smaller lists, you repeat the same process in choosing a pivot and comparing the numbers to it. After you have done this to the 2 minor lists, you will see that the numbers are now in order.
- 10WTh list goes through an unsorted list of numbers with the aim of finding one specific one. It will compare each number in the list with the number its looking for and once it has found, the search is finished
- 11What is a Binary search?A binary search, also known as a half interval search is a search that looks for one specific number within a sorted array. The list is firstly split in half. Then the search will look at the number on the right, if the number is smaller than the number it is looking for, the search will cross out that whole section and half the section on the right in the middle and repeat the same process until it finds the number
Informações
- Descrição
- - Computing FlashCards sobre Topic 1 - computing - algorithms , criado por stef Adam em 07-06-2016.
- Criado por
- stef Adam
- Visualizações
- 2
- Avaliação