Applied algorithmic thinking: Difference between revisions
Mr. MacKenty (talk | contribs) No edit summary |
Mr. MacKenty (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
Once you can define an [[algorithms]] you must analyze and deduce algorithms. Really, you need to '''trace''' what an algorithm does. | Once you can define an [[algorithms]] you must analyze and deduce algorithms. Really, you need to '''trace''' what an algorithm does. | ||
The algorithm below is well-named. Can you deduce what it might do? | |||
<syntaxhighlight lang="python" line> | <syntaxhighlight lang="python" line> | ||
def find_max (L): | def find_max (L): | ||
Line 11: | Line 12: | ||
return max | return max | ||
</syntaxhighlight> | </syntaxhighlight> | ||
If you said something like "find the largest number in a list (or array) you are correct. | |||
== Do you understand this ? == | == Do you understand this ? == |
Latest revision as of 05:32, 29 July 2017
Once you can define an algorithms you must analyze and deduce algorithms. Really, you need to trace what an algorithm does.
The algorithm below is well-named. Can you deduce what it might do?
def find_max (L):
max = 0
for x in L:
if x > max:
max = x
return max
If you said something like "find the largest number in a list (or array) you are correct.
Do you understand this ?[edit]
Standards[edit]
These standards are used from the IB Computer Science Subject Guide[1]
- Discuss an algorithm to solve a specific problem.
- Analyse an algorithm presented as a flow chart.
- Analyse an algorithm presented as pseudocode.
- Construct pseudocode to represent an algorithm.
- Suggest suitable algorithms to solve a specific problem.
- Deduce the efficiency of an algorithm in the context of its use.
- Determine the number of times a step in an algorithm will be performed for given input data
.
References[edit]
- ↑ IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.