Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

Revision - 2.1 Searching Algorithms

E- LEARNING

Revise, Recap, Review

Objectives

3 aspects of computational thinking

2 registers used in fetch, decode, execute cycle

The name of the register used to store the address of the next instruction in the cycle

Lesson Objectives

To understand how to write algorithms using flow diagrams

To understand how a linear search works

To understand how a binary search works

Flow Diagrams

A flow diagram is a visual representation of how an algorithm works.

There are 5 symbols you will need to know for your exam that will enable you to draw these

Theory

Start/End

At the beginning and end of your algorithm you will need boxes with rounded corners

Inputs/Outputs

Any inputs or outputs (print statements) go in a parallelogram box

Actions/process

Rectangular boxes represent an action or process i.e. wages = wages * 1.1

Decisions

Diamond shaped boxes are used to store decisions - these are your IF statements and loops!

Sub routines

A sub routine (functions and procedures) go in boxes like this

Task

Task

Create a flow diagram for an algorithm that:

  • Accepts a movie running time in minutes
  • Converts minutes to seconds
  • Prints out the total

WAGOLL

Hexadecimal

This is a number system that we will learn more about later, but instead of the 10 symbols we use in decimal (0-9) there are 16 symbols.

0-9 have the same value in hex as they do in decimal, but we have 6 further symbols:

A = 10

B = 11

C = 12

D =13

E = 14

F = 15

Task

Create a flow diagram for an algorithm that:

Accepts a number between 0 - 15

Converts the number into hexadecimal

Prints the result

WAGOLL

Searching Algorithms

Searching

You need to know about two algorithms that search for information - the linear search and the binary search

Linear Search

Easy to understand!

A linear search looks at each item in the list and checks if it is what we are looking for! If not, we check the next item and so on.....

Binary Search

Can only work on a list that is in order

Looks at middle item (length of list + 1 / 2)

If the middle item is too big, get rid of the second half, if it's too small, get rid of the first half

Binary Search

Now you have a list half of the size to search!

Repeat the process until you've found what you are looking for!

YouTube Strangeness....

Exam Questions

Likely to ask you to search a list in the exam paper using either of these methods

OR to explain how they work, so you need to know HOW they work

Task

Task

Learn more about creating dynamic, engaging presentations with Prezi