Beaky
You can read minds?
Approaching algorithims by Sam Davis
The main problem is that every algorithm question is different. Writing algorithms is not something you can learn by rote and just spew out an answer. However you do need to understand the principles behind each of the standard searches and sorts. Some possible tips include:
- Try to solve a simpler case of the question first. For example work out how to process a single record first and then add the loops to iterate around through the whole record set and then generalise any constants by changing them to variables.
- Design data structures first. That is, write down the structure of any arrays or records you'll be using. This helps you maintain focus while you construct your algorithm and it also gives the marker a clearer understanding of where your answer is headed.
- The best answers solve the problem in the most efficient manner. If you think you've solved it then when checking think about ways to get out of loops as soon as the vital processing is done. For example setting a flag and using it as part of your loop condition. This can make the difference between 5/6 and 6/6.
- Generally better answers tend to be written in pseudocode. Pseudocode has the advantage of restricting you to standard control structures. Its also easier to slot in or remove statements here and there as you check your answer.
- If you're stuck then think in terms of simple example data. If you can actually do the processing on some example data then write down how you do that in step by step form. This will likely gain you a few marks and it may just allow you to formulate a more generalised algorithm.
- If you really have no idea then as a last resort reword the question in step by step form. Many algorithm questions are quite specific, and even the question itself contains a series of steps. Remember the aim is to rank student responses, at least you've shown that you understood the question whereas writing nothing always results in a zero.
- Everyone makes stupid mistakes. The best time to spot these is later on. Plan to have time at the end of the exam to reread all your answers, particularly the algorithms.
HTH
Sam Davis
The main problem is that every algorithm question is different. Writing algorithms is not something you can learn by rote and just spew out an answer. However you do need to understand the principles behind each of the standard searches and sorts. Some possible tips include:
- Try to solve a simpler case of the question first. For example work out how to process a single record first and then add the loops to iterate around through the whole record set and then generalise any constants by changing them to variables.
- Design data structures first. That is, write down the structure of any arrays or records you'll be using. This helps you maintain focus while you construct your algorithm and it also gives the marker a clearer understanding of where your answer is headed.
- The best answers solve the problem in the most efficient manner. If you think you've solved it then when checking think about ways to get out of loops as soon as the vital processing is done. For example setting a flag and using it as part of your loop condition. This can make the difference between 5/6 and 6/6.
- Generally better answers tend to be written in pseudocode. Pseudocode has the advantage of restricting you to standard control structures. Its also easier to slot in or remove statements here and there as you check your answer.
- If you're stuck then think in terms of simple example data. If you can actually do the processing on some example data then write down how you do that in step by step form. This will likely gain you a few marks and it may just allow you to formulate a more generalised algorithm.
- If you really have no idea then as a last resort reword the question in step by step form. Many algorithm questions are quite specific, and even the question itself contains a series of steps. Remember the aim is to rank student responses, at least you've shown that you understood the question whereas writing nothing always results in a zero.
- Everyone makes stupid mistakes. The best time to spot these is later on. Plan to have time at the end of the exam to reread all your answers, particularly the algorithms.
HTH
Sam Davis