Applied algorithmic thinking: Difference between revisions
Mr. MacKenty (talk | contribs) No edit summary |
Mr. MacKenty (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:computation.png|frame|right|This is a basic concept in computer science]] | [[File:computation.png|frame|right|This is a basic concept in computer science]] | ||
Once you can define an [[ | 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> | |||
def find_max (L): | |||
max = 0 | |||
for x in L: | |||
if x > max: | |||
max = x | |||
return max | |||
</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.