Algorithms

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

What is decomposition?

Breaking a complex problem down into smaller problems and solving each one individually

2
New cards

What is algorithmic thinking?

A logical way of getting from the problem to the solution

3
New cards

What is abstraction?

Picking out the important bits of information from the problem, ignoring the specific details that dont matter

4
New cards

What is pseudocode? What are the advantages of it?

Pseudocode clearly shows an algorithms steps without worrying about the finer details

  • Quick to write

  • Easy to understand

5
New cards

What do flowcharts do?

A flowchart is a diagram that visually represents the steps and decisions in a process or workflow

6
New cards
<p>What does the box with rounded corners show in a flowchart?</p>

What does the box with rounded corners show in a flowchart?

The beginning/end of the algorithm

7
New cards
<p>What is the parallelogram box in a flowchart?</p>

What is the parallelogram box in a flowchart?

Anything thats put into or taken out the algorithm

8
New cards
<p>What does is rectangular box in a flowchart?</p>

What does is rectangular box in a flowchart?

General instructions, calculations or processes

9
New cards
<p>What is the dimond box in a flowchart?</p>

What is the dimond box in a flowchart?

A decision

10
New cards
<p>What is the rectangle box with lines in a flowchart? </p>

What is the rectangle box with lines in a flowchart?

A sub program

11
New cards

What is the arrow in a flow chart?

Shows which way to follow and connects boxes

12
New cards

Describe sequences flowcharts

A flowchart where there is only one way from start to the end

13
New cards

Describe selections flowcharts

A flowchart with selections/mutiple ways to get from start to stop

14
New cards

Describe iterations flowcharts?

Contains a loop which allows you to repeat a task

15
New cards

What does a binary search do?

Looks for items in a ordered list

16
New cards

How is bineary search carried out?

  • Find the middle item in the ordered list ((n + 1) / 2 = the middle number - round up if neccesary)

  • If this is the item your looking for, stop the search

  • If not, compare the item you looking for with the middle item and figure out which side of the middle item it will be on

  • Remove the side (first half or second half) the item your looking for is not on

  • Youll be left with a list half the size of the original list

  • Repeat the steps on the smaller list until you found your item

17
New cards

What does linear search do?

Looks for items on unordered list

18
New cards

How is linear search carried out?

  • Look at the first item in the unordered list

  • If this is the item your looking for - stop the search

  • If its not the item, look at the next item on the list

  • Repeat these steps until you find iy

19
New cards

What does a bubble sort do?

Compares pairs of items and sorts an unordered list

20
New cards

How is a bubble sort carried out?

  • Look at the first two items of the list

  • If they are in the right order you dont have to do anything but if they are in the wrong oder, swap them

  • Move on to the next pair of items (2nd and 3rd)

  • Repeat these steps until there is no more to swap

21
New cards

What are the advantages of bubble sorts?

  • Simple algorithm that can be easily carried out on a computer

  • Efficient way to check a list is already in order

  • Doesnt use much memory

22
New cards

What are the disadvantages of bubble sorts?

  • Inefficient way to sort a list

  • Does not cope well with large lists

23
New cards

What does a merge sort do?

Splits the list apart then merges it back together into the right order

24
New cards

How are merge sorts carried out?

  • Split the list in half (the smaller list is called the sub-list)

  • Keep repeating step one until all the list only contain one

  • Merge pairs of sub-lists so that each sub-lists has twice as many items

  • Order it while doing this

  • Repeat step three until you’ve merged all the sub-lists

25
New cards

What are the advantages to merge sorts?

  • More efficient and quicker then bubble sort

  • Consistent running time regardless of how unordered the items on the original list are

26
New cards

What are the disadvantages to merge sorts?

  • Slow for small lists

  • Even if a list is already sorted it stil goes through the whole process

  • Uses more memory

27
New cards

What does insertion sorts do?

Orders items on a list as it goes

28
New cards

How are insertion sorts carried out?

  • Look at the second item on the list

  • Compare it to all items before it and insert the number into the right place

  • Repeat these steps while going down the rest of the list until its ordered

29
New cards

What are the advantages to insertion sorts?

  • Very efficient

  • Easy to code

  • Works well with short lists

  • Doesnt require a lot of memory

  • Quick to add items to a already ordered list

  • Quick at checking the list is already ordered

30
New cards

What are the disadvantages to insertion sorts?

  • Doesnt cope well with very large lists