Boost PC performance: How more available memory can improve productivity
Search flowchart
1.
2. 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
3.
4.
5.
6. 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 =
item
Found = 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
Yes
Yes
Yes
No
Yes
No
Notas del editor
Good layout & easy to follow.No stop function!
Start1Input item searching for 1Set found to falseSet bottom to 0Set top to max-1Cut the top half of the elements