search flowchart

6

Upload: hout300

Post on 12-Jan-2015

361 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Search flowchart
Page 2: Search flowchart

Start

Search Item

Set index to 1

Set found to false

While not found and not end of

array

If item = search

Found = true

If true

Item output found

Item not found

Location = index

No Yes

Yes

YesNo

No

Linear SearchFlowchart

Page 3: Search flowchart
Page 4: Search flowchart
Page 5: Search flowchart
Page 6: Search flowchart

Start

Input item searching

for

Set found to false

Set bottom to 0

Set top to (MAX -1) elements

While bottom <=

top and not found

Middle = (bottom + top)/2

If list at middle =

itemFound = true

If list at middle <

item

Location = middle

Bottom = middle + 1

Top = middle - 1

If found = true

Output item was not found

Output location

item found Stop

Yes

No

YesYes

Yes

No

Yes

No

Olivia Houten
Confusing lines. please consider.
Olivia Houten
Overall, very good but please sort your lines out.
Olivia Houten
Where is this line pointing to? I need arrows not lines
Olivia Houten
Where is this line going to? Please be clear!
Olivia Houten
60% overall...See me for some extra help!!
Olivia Houten
This needs to go back into the while loop. Because when an item is not located you stop and search for it again.
Olivia Houten
Overall, I can see a lot of effort here, Im really impressed well done! - Jas.